Skip to content

Instantly share code, notes, and snippets.

@yhsiang
Last active August 29, 2015 14:12
Show Gist options
  • Save yhsiang/c2360b8a96b9d5f947e5 to your computer and use it in GitHub Desktop.
Save yhsiang/c2360b8a96b9d5f947e5 to your computer and use it in GitHub Desktop.
Note: upgrade discourse from xdite fork to docker version

UPGRADE

  1. Flush your new Discourse's database. This step is destructive; you must be absolutely certain that you are in the correct container, connecting to the correct database and that it contains no important data.

ssh root@hostname -p 2222

sudo -u postgres psql discourse <<END
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
ALTER SCHEMA public OWNER TO discourse;
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE EXTENSION IF NOT EXISTS pg_trgm;
END
  1. Restore the backup data:

su - discourse rm -rf /var/www/discourse/public/uploads tar -C /var/www/discourse/public xzf /shared/discourse-uploads.tar.gz psql -d discourse -f /shared/discourse-backup.sql

  1. Bring the old database up-to-date by migrating it:

cd /var/www/discourse RAILS_ENV=production bundle exec rake db:migrate

  1. Exit and restart the container:

exit exit ./launcher restart app

  1. Login web
  • Settings -> Backup -> allow restore
  • Backups -> upload backup file -> restore

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment