Having spent some time on debugging a java/mingle issue recently, I document here some useful steps for dealing with backing up, restoring, resetting to default and migrating mingle.
My $MINGLE_DATA_DIR = /var/lib/mingle
My $MINGLE_INSTALL_DIR = /home/mingle/current-mingle
Observe the following advice from Mingle team:
My $MINGLE_DATA_DIR = /var/lib/mingle
My $MINGLE_INSTALL_DIR = /home/mingle/current-mingle
Backup mingle
- Exported projects of interest manually via web UI
For a lot of projects, alternatively use $MINGLE_INSTALL_DIR/tools/export_import/export_all_projects.rb
Exports end up in $MINGLE_INSTALL_DIR/exported_projects - stop mingle
$ invoke-rc.d mingled stop - backup /var/lib/mingle
$ cp -a /var/lib/mingle{,~backup} - postgres dumpall
$ sudo -u postgres -i -- pg_dumpall > ~/postgre-dumpall-pre-mingle-drop.dump
Reset mingle to near out of the box status
- backup per above (mingle will be stopped)
- $ rm -r /var/lib/mingle/*
- $ sudo -u postgres -i -- psql -d mingle -c "DROP SCHEMA public CASCADE;"
Mingle full purge and restore (out of the box)
- backup per above (mingle will be stopped)
- $ rm -r /var/lib/mingle/* $MINGLE_INSTALL_DIR
- $ invoke-rc.d postgresql stop
- $ mv -v /var/lib/postgresql/$VERSION{,~} && mv -v /etc/postgresql/$VERSION {,~}
- $ pg_createcluster --start $VERSION main
- check and diffs on the new cluster, including port, make a note of the db port
$ diff -r /etc/postgresql/ $VERSION ~ /etc/postgresql/$VERSION - restore the db dump
$ sudo -u postgres -i -- psql -f postgre-dumpall-pre-mingle-drop.dump postgres|less
$ sudo -u postgres -i -- vacuumdb -a -z - extract mingle tgz
- launch mingle
Server migration
Observe the following advice from Mingle team:
- complete the Mingle installation process using the new database settings completely, including creation of an initial user
- license the new instance
- create any users who are not associated with a project manually using Mingle as they will not be imported with the projects
- review the templates after the import has completed to remove any duplicates of the standard templates that may have been installed
- backup per above (mingle will be stopped)
- tgz and move your $MINGLE_DATA_DIR backup and psql dump to the new server
- install postgres on the target server, note the port
- restore the db dump, this will create users and the db
$ sudo -u postgres -i -- psql -f postgre-dumpall-pre-mingle-drop.dump postgres|less
$ sudo -u postgres -i -- vacuumdb -a -z - extract your $MINGLE_DATA_DIR , set permissions, set db port as required
- extract mingle from its tgz to $MINGLE_INSTALL_DIR
- launch mingle
Importing projects from the cli/shell
- $ mkdir $MINGLE_INSTALL_DIR/exported_projects
- place your .mingle files in aforementioned dir
- run the importer script
$ tools/run tools/export_import/import_projects.rb --mingle.dataDir=$MINGLE_DATA_DIR
No comments:
Post a Comment