Forum .LRN Q&A: Re: changing machines

Collapse
2: Re: changing machines (response to 1)
Posted by Nima Mazloumi on
William,

more important is the question which version is running on the old box and which on the new? Migration is very easy once you have AOLServer and PostgreSQL installed. Simply create a dump of your source database. Then - if your code versions differ or if you have uploaded files you need - tar-gzip your openacs-root folder. Then unpack the tar.gz in your target system and load your database dump to postgres. That's it.

Here the steps

- Make an archive of your source installation:
tar czpf my_archive.tar.gz [openacs-root-folder]

- Make a dump of your source database. Where database user is equal to database name.

First change user:

su - [database-user]

Then create the dump:

pg_dump [database-name] > my.dump

Now copy the stuff to your target box.
Make a backup of your target installation:

mv [openacs-root-folder] my-backup

Extract the archive:

tar zxpf my_archive.tar.gz

Make a dump of the target database for backup reasons. See above.

Drop your target database:
dropdb [database-name]

Create a new database:
createdb -E UNICODE [database-name]

Load you database dump:
psql [database-name] < my.dump

All the above assumes that you have use the same name on both boxes as system user, database name, database user. Change the lines accordingly if you didn't.