-
Notifications
You must be signed in to change notification settings - Fork 28
2. Deploying
For existing projects run on WordPress Starter deployment process has a few tricks.
We assume that you're using GIT repository, because it's a right way to keep your code safe!
cd /path/to/your/project/empty/folder/
git clone http://git-storage-domain.com/your/project.git ./
composer install
This will download WordPress core files and public plugins.
Update your .env
file with Database credentials, your host and environment (development
, 'staging
, production
).
-
DB_NAME
- Database name -
DB_USER
- Database user -
DB_PASSWORD
- Database password -
DB_HOST
- Database host -
WP_ENV
- Set to environment (development
,staging
,production
) -
WP_HOME
- Full URL to WordPress home (http://example.com)
Update your .htaccess
file with new subfolder if you moved site into another subfolder.
- Update RewriteBase
- Update RewriteRule, which redirects wp-admin to cms/wp-admin
- Update main RewriteRule with index.php
Import database dump with your favorite database software.
WordPress stores a lot URLs inside the database, so after migrating a site to a different domain/folder you have to upgrade you database. Furthermore, WordPress serialize a lot data inside, so you can't do this with simple MySQL query.
Fortunately, we have a lot of tools which can help us with that:
- WP Host update
- WP Migrate
- WP CLI
We recommend to follow Gitflow Workflow.
According to Gitflow:
-
master
- is a stable production copy -
develop
- is a current development copy
To switch branch just use GIT:
git checkout <branch-name>
To regenerate WP rewrite rules just open Dashboard -> Settings -> Permalinks and press Save button.
Next: Folder Structure