I have two OpenACS servers, each serving a different site. I'm going to move site A to site B's hardware, so that both of them will run off of the same hardware.
The name of the database will be called siteA.
This all took me less than an hour, including writing up this documentation. However, I leave off with the documentation before the whole job is done :-)
pg_dump -f db_backup_030729.dmp siteA
cd /cvsroot tar -cf siteA.tar siteA gzip siteA.tar
Log in to site B, as a normal user sftp root@siteA.com sftp> cd /cvsroot sftp> get siteA.tar.gz sftp> cd /web/siteA/database-backup sftp> get db_backup_030729.dmp sftp> exit su - cd ~username mv siteA.tar.gz /cvsroot cd /cvsroot tar -xzf siteA.tar.gz
Follow the rest of the directions on how to set up the user on the OpenACS Official Documentation. Specifically, on setting up the .bashrc and/or .bash_profile files. Make sure you add in the CVSROOT.useradd -m -g web siteA su - siteA
ls -lh chown -R siteA.web siteA
su - siteA cd /web cvs checkout siteA
If you get an error like this while restoring:
The problem is you have users with different names. The way I got around this is...psql -f db_backup_030622.dmp siteA You are now connected as new user postgres. psql:db_backup_030622.dmp:12: ERROR: function plpgsql_call_handler already exists with same argument types psql:db_backup_030622.dmp:20: ERROR: Language plpgsql already exists psql:db_backup_030622.dmp:22: \connect: FATAL 1: user "siteA" does not exist
I opened up the .dmp file in emacs and replaces all the references to the old siteA user to the new one.