Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Replace a Manual Install with Deb Package

TechWilk edited this page Jul 7, 2016 · 4 revisions

If you did a Manual Installation of OneBody, or if you installed using our DigitalOcean Installer, Virtual Appliance, or Amazon AMI, you may wish to convert this installation to use our newer Deb Package. Here's roughly how to do it:

  1. Backup the database.

    mysqldump -u onebody -p onebody > /var/www/onebody/db/onebody.sql
    

    Enter "onebody" for the password when prompted (unless you changed it to something else).

  2. Follow the instructions here to install the deb package on your machine. Do not install nginx as suggested by the package itself -- we'll use your existing Apache server instead.

  3. Copy the user-generated files (documents, pictures, etc.) over to the new install directory:

    rsync -av /var/www/onebody/public/system/ /opt/onebody/public/system/
    
  4. Edit the file /etc/apache2/sites-available/000-default.conf.

    1. Comment out the following lines (put a # in front of them):

      #DocumentRoot /var/www/onebody/public
      #XSendFile On
      #XSendFilePath /var/www/onebody/public/system
      

      Once everything is running on the new OneBody instance, you can delete these lines.

    2. Past the following lines below them:

      <Proxy "balancer://onebody">
        BalancerMember "http://localhost:3000"
      </Proxy>
      ProxyPass / balancer://onebody/
      ProxyPassReverse / balancer://onebody/
      
    3. Save the file and exit the editor.

  5. Enable the proxy modules:

    sudo a2enmod proxy proxy_http proxy_balancer lbmethod_byrequests
    sudo service apache2 restart
    

That's it! Check that your site is still running and everything looks ok.

Further Reading

Scaling OneBody

Abort! (Put it back like it was)

If something goes terribly wrong and you don't want to debug it, you can point Apache back to your existing install like this:

  1. Delete the lines added to /etc/apache2/sites-available/000-default.conf and uncomment (remove the #) the lines we hid before.

  2. Restart Apache:

    sudo service apache2 restart
    
  3. Restore your database:

    mysql -u onebody -p onebody < /var/www/onebody/db/onebody.sql
    
  4. (Optional) uninstall the OneBody package.