Skip to content

Manual Installation & Upgrades

Matthew Orres edited this page Jan 27, 2019 · 3 revisions

If you are unable to use the automated deployment process outlined in the installation instructions, there is are a few additional boxes that you must check in order to manually install PHP Draft 2.2+:

  • Must have a MySQL instance with a login that you can login to from outside of the server, and has full read/write permissions to the PHP Draft database.
  • Must have PHP installed in order to run the Phinx migration tool
  • Must have Yarn installed to download frontend packages for the app to use

Switching from hand SQL to Phinx requires that the list of migrations found in /db/migrations be local to the Phinx command line tool as it connects to the database.

**If upgrading from version 2.1, first follow the upgrade instructions skipping parts involving symlinks and using the deploy feature.

Got it? Let's go!

  1. Backup all app files on the webserver and the database structure and contents before beginning - if anything goes sideways (things do from time to time, it happens!) you'll need them to restore your app.
  2. Download the latest release from the project releases page and extract the project to a temporary local directory.
  3. Symlinks are not necessary with manual installations, and thus you can upload app files as necessary.
  4. Open a command prompt or terminal on your computer, and navigate to the temporary local directory (same folder as index.html).
    • If this is a new install Type vendor/bin/dep setup local and hit enter to begin the automated PHP Draft settings wizard. It will ask you questions in the terminal window, type in the answers and hit enter to save.
    • If this is an upgrade Type vendor/bin/dep import local and type the location of your saved app settings.
    • The local part of the Deployer commands corresponds to the "stage" specified in your specific deploy.php. If you never change this value, then always specify local, but if you have multiple instances sometimes it is helpful to ensure that you are explicit about which environment is getting touched.
  5. In the command prompt/terminal, type yarn install --production. This will download all NPM packages and place them in node_modules, which you will soon upload.
  6. If your Hoot Draft install will be at the base of the domain or subdomain (as in sub.example.com or www.example.com), you may skip this step. If your base URL looks like www.example.com/hootdraft, do the following:
    • Open index.html and find this HTML: <base href="/"> and change it to match the directory path after the base domain. So if your base URL is www.example.com/hootdraft, then you must edit the HTML like this: <base href="/hootdraft/">
  7. SKIP IF UPGRADING WITH IMPORTED SETTINGS Make any necessary changes to your .htaccess (Unix-like) or web.config (Windows) config files.
    • If you updated base href tag in index.html above, you'll need to edit line 5 of .htaccess like so: RewriteBase /hootdraft
  8. SKIP IF UPGRADING WITH IMPORTED SETTINGS Once the settings wizard has finished, type vendor/bin/dep backup local to take the settings files the wizard created for you in the last step, and back them up in a secure folder elsewhere on this machine.

This is helpful when upgrading the app in the future, as you can import these settings before deploying the application. A good suggestion is within your logged in user's home folder (along side Documents and Downloads folders, for example) in a folder called "phpdraft_settings". If you have more than 1 install, you would need to keep them in separate folders within phpdraft_settings

  1. Now in the command prompt/terminal, perform the following operations to perform database migrations:
    • php deploy/phinx.phar breakpoint -e production --remove-all (remove any existing breakpoints)
    • php deploy/phinx.phar breakpoint -e production (create a new one if we need to go back to it)
    • php deploy/phinx.phar migrate -e production
  2. Now, upload the contents of the local directory to the webserver. Ensure that the node_modules and vendor folders are included (vendor and node_modules are quite large, so it will take a few minutes to upload them)

That's it! Verify that the new code is running in your web browser, but you should be running the latest and greatest version.

Clone this wiki locally