Database migration labgeeksrpg to labgeeks - abztrakt/labgeeks-buildout GitHub Wiki

The app structure is very different in the new labgeeks, so you should build the app from scratch as detailed in how to deploy with apache. Below are instructions to help you move your old database and uploaded files over to the new app.


Moving your database:

The basic process is dump, load, migrate. (In each step it is assumed that the name of your database is labgeeks. It can be whatever you want it to be. You will need root access to mysql on both servers)

To dump, go to your old labgeeksrpg server and execute this command mysqldump -u root -p labgeeks > nameoffile.sql

Use scp or sftp to move the file nameoffile.sql (or whateveryoucalledit.sql) to the new server and go to the directory where you put it.

To load the data, execute this command before running syncdb (if your database has tables from syncdb or migrate when you load data, the migrate step will fail)

mysql -u root -p labgeeks < nameoffile.sql

cd into /var/django/labgeeks-buildout/extras/

To migrate your old db to the new schema, execute this command

mysql -u root -p labgeeks < labgeeksmigration.sql

You will now need to reset south. With your labgeeks-buildout virtualenv activated, execute these commands

labgeeks reset south

labgeeks migrate --all --fake 0001

Continue with the instructions in how to deploy with apache.

When you get to the end of those instructions, move your uploads folder to the new server. The uploads folder's home on the new server is in /var/www/. You can use sftp into your old labgeeksrpg from /var/www/ and get -r uploads/ or you can tar the uploads folder, scp it to /var/www/ on the new server and untar it. Then just make sure the uploads folder (and all folders inside) is group www-data and the group has write permission (chgrp www-data uploads/, chmod g+w uploads/)