-
Notifications
You must be signed in to change notification settings - Fork 23
Manual Installation & Upgrades
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!
- 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.
- Download the latest release from the project releases page and extract the project to a temporary local directory.
- Symlinks are not necessary with manual installations, and thus you can upload app files as necessary.
- 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 specificdeploy.php
. If you never change this value, then always specifylocal
, but if you have multiple instances sometimes it is helpful to ensure that you are explicit about which environment is getting touched.
-
If this is a new install Type
- In the command prompt/terminal, type
yarn install --production
. This will download all NPM packages and place them innode_modules
, which you will soon upload. - If your Hoot Draft install will be at the base of the domain or subdomain (as in
sub.example.com
orwww.example.com
), you may skip this step. If your base URL looks likewww.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 iswww.example.com/hootdraft
, then you must edit the HTML like this:<base href="/hootdraft/">
- Open
-
SKIP IF UPGRADING WITH IMPORTED SETTINGS Make any necessary changes to your
.htaccess
(Unix-like) orweb.config
(Windows) config files.- If you updated base
href
tag inindex.html
above, you'll need to edit line 5 of.htaccess
like so:RewriteBase /hootdraft
- If you updated base
-
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
- 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
-
- Now, upload the contents of the local directory to the webserver. Ensure that the
node_modules
andvendor
folders are included (vendor
andnode_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.