This post originally appeared on the Strattic.com blog on April 21, 2021.
WordPress has a reputation for being an old-school piece of software, but while it runs on what is perceived as a legacy server stack, it can most definitely be used in conjunction with modern web development workflows. Many developers around the globe are busy building large-scale, sophisticated WordPress projects, and utilize such techniques as CI/CD and version control (gasp!) while doing so.
At Strattic, many of our customers are like the ones I described above, and thatâs why we often get asked about how to set up development and deployment workflows with WordPress in general, and with static WordPress specifically. There are many ways to do this, and many great solutions out there that try to make CI/CD with WordPress a breeze.
While our mission at Strattic is to make WordPress sites faster, more scalable, and completely secure, we also aim to help teams of developers and stakeholders be efficient and effective in managing and growing their sites. This post aims to do just that: help you build and utilize a workflow that allows you to both keep your code under version control, while not worrying about overwriting your production database.
Weâve all been there, and itâs no fun.
This guide assumes that you have a working knowledge of setting up a local development environment, a production site (hopefully on Strattic!), knowledge of Git and version control, and you need to manage multiple environments and components without losing your mind.
Donât worry! Weâre here to help! 🤓
In this guide, I will also be making use of a premium plugin called WP Migrate DB Pro with its Media Files addon, which handles database and media files migration, as well as serialized search and replace, migration profile creation, and one-click migrations. Iâve used it on (Iâm not exaggerating) hundreds of sites over the last half-decade and can only sing its praises. There are other migration tools available, but this one takes the cake! (And you know we love cake at Strattic)
Before we get started, thereâs some common ground we need to establish.
Overview and understanding
In this article, Iâll be referring to the WordPress site hosted on Strattic as your âProduction environmentâ and, assuming you are developing on your laptop or desktop machine, your local development environment as âLocal environmentâ (or just Production and Local, respectively). Please note, on Strattic, there is also a âLiveâ static site, and a âPreviewâ static site, which are created or updated when you publish your Production WordPress site.
There are numerous ways you could set up your workflow, and you might also have a âdevelopmentâ environment where your development team tests new features, or a âstagingâ environment, where your QA team might go through automated and manual testing. The combinations and possibilities are endless, and Iâm limiting environments to Production and Local for ease of explanation.
It is also important to think of your WordPress project as three separate pieces:
- Code
- Database
- Media Files (or âUploadsâ)
Each of these is distinct in how they should be understood, organized, and managed. Since weâll be dealing with multiple environments, knowing where your âsource of truthâ for each of these components is very important. Weâll look at them in the next section.
Syncing vs migration
Itâs important to know the difference between âsyncingâ and âmigratingâ sites.
- Sync code: This makes sure that both of your sites (Production and Local) are using the same codebase.
- Migrate databases: If you need to have the latest version of the database, it is much better to âmigrateâ one siteâs DB to another. Many companies have tried to build a solution that could sync databases, but a MySQL database is much different than a code repository in structure, purpose, and form. So, weâll focus on migrating databases, rather than syncing them.
Backups. Ho hum. But seriously.
Always make sure you have a recent backup of at least your Production environment before you attempt to set up a deployment workflow. At Strattic, daily backups are automated, and if you want to trigger a backup, you can do so in your dashboard.
Ok, with these important considerations discussed, letâs look at an overview of the deployment workflow.
The ideal workflow for working with WordPress:
As you might guess, the workflow laid out here is specific to WordPress. The process might differ from other websites or web apps youâve worked on before.
The workflow can be summed up in this sentence:
âCode goes up, Database and Media Files go downâ.
What does this mean in practice?
First, code moves from a Local environment to a Production environment, i.e. up â. âCodeâ is everything you want to version control, typically files ending in a .php, .js, .css, or .html extension (and sure, if youâre doing JSX or React stuff, or Vue stuff, youâre going to version control .jsx, .vue, .whatever files).
The source of truth for the codebase should always be the default, main, or master branch of your Git repository.
Next, database and media files move from the Production environment to the Local environment, i.e. down â. Just about everything that is managed in the WordPress admin area (posts, pages, plugin and theme settings) gets saved in the database.Your database should not contain any executable code (though this sometimes occurs when plugins store code in the database). Essentially, if youâre using wp-admin to make and save a change, itâs probably getting saved in the database.
The source of truth for the database of a site should always be the Production database.
Media files (or âuploadsâ) are typically uploaded through the wp-admin. Some transformations on the images are done based on database settings at that time. The images are not stored in the database, but are stored in a file system. These media files and other uploads are not code, so they donât need version control. However, you do need to be aware of them, as during a migration and while replacing URL strings, if you donât move your images from one site to another, image files will break, and other files in the uploads folder (e.g. caching scripts) will break your site.
The source of truth for the media files or uploads of a site should always be the Production database and media files.
This is the workflow weâll be covering below. The basis for this workflow, I believe, was started by Pantheon here.
However, on Strattic, the workflow and concepts are a little different, since your Live static site is a static replica of your WordPress site, and there is no âdatabaseâ in a typical WordPress sense.
Ready? Ok, letâs begin.
Step 1: Backup and download your Production site from your host
If youâve got your Production site running on Strattic, this is the easy part! 😎 Most quality WordPress hosts today, like Strattic, will run daily backups that you can both trigger and access to download. If your current host does not offer this service, consider checking us out!

To use Strattic as an example, go to your dashboard, click on the âWordPress Backupsâ tab, and download the most recent backup. You may also choose to trigger a backup if youâve made changes to your site after the most recent daily backup. If youâd like to make an on-demand backup, click âBackup nowâ.
Once your backup is ready, click the download icon, and wait for your backup file to download. If you have a large site with many media files or your backup is massive, it might take some time. Strattic provides you with a full backup that includes your WordPress core code install, any custom code youâve added in the wp-content folder,, uploads, and a database export.
Once you have that zip file, youâre ready to move on to the next step.
Step 2: Set up your local development environment
As mentioned above, this guide assumes you already have your favorite local development environment set up. Any of the following options should work for our purposes:
- Local from Flywheel
- XAMPP, WAMP, MAMP
- DesktopServer
- Valet or Homestead (hello Laravel folks!)
- VVV (or any Vagrant and Virtual Box setup)
- WP Local Docker (or any local Docker setup)
If it runs WordPress on your local machine, you should be good to go.
Using your local development environment, set up a fresh install of WordPress. Normally, this includes the latest version of WordPress. If you are looking to use a different version of WordPress than what comes with a fresh install, make sure you install the correct version of WordPress core.
This is now your Local environment.
Once you have everything set up, you can begin to move your code files into your Local environment. Code should always be moved first, before the database is migrated, as the database may rely on some code being present. For example, if you have the default WordPress âTwenty Twentyâ theme active on your Production environment, but only have the âTwenty Twenty Oneâ theme installed on your Local, when you migrate the database and media files from Production to Local, you will get a white screen on your local, or if you have WP_DEBUG set to âtrueâ, you might see a warning that says âThe theme TwentyTwenty does not exist.â
The wp-content folder is the directory where you should make and keep all custom aspects of your WordPress installation. This includes the plugins, mu-plugins, themes, and uploads directories. Other commercial and community plugins also tend to make use of this directory as well to store generated PHP, JS, JSON, or media files needed by their plugins.
In most cases you just need to copy over your wp-content folder from the backup you got from your Strattic dashboard. Of course, this will also bring over the wp-content/uploads folder which has your media files in it, which is exactly what we want, as weâll see in the next step.
Once your code is copied over from your Production to your Local, itâs time to migrate the database.
Step 3: Migrate your database and media files from Production to Local
This is the final step in bringing your Production environment to your Local environment. To do this, we will migrate the Production database and media files from Production to Local. As mentioned above, we will use the WP Migrate DB Pro plugin with the Media Files addon to accomplish the migration.
If you havenât already, download the core WP Migrate DB Pro plugin and the media files addon from your account on DeliciousBrains.com. Install and activate both plugins on both your Production and Local environments.
When you activate the plugins, youâll get a notification on the WordPress Plugins page that you need to activate your license key. Click on the provided link, which will take you into the WP Migrate DB Pro settings. On that page, do the following:
- Enter the license key (this can be done on both installs).
- Set the âPermissionsâ in Production environment to âPullâ and in your Local environment to âPushâ, this will keep you overwriting your Production database with your Local (or another) database.
- Click âCopy to Clipboardâ from the âConnection Infoâ from the Production environment â youâll need that soon for your Local environment (this connection information is randomly generated by the plugin).
Your Production environment settings page should look something like this:

Great! You are now ready to pull your Production database and media files to your Local environment.
Now, on your Local environment, navigate to the WP Migrate DB Pro Migrate tab, and select âPullâ to start a migration profile:

Paste in the connection info you copied from your Production site to your Local and click âConnectâ. Since you will be pulling from your Production environment on Strattic, youâll also need to provide the HTTP Auth for your site. This can be found in your Strattic dashboard under the site details.
Once connected, youâll be able to configure the migration. To get started, configure the following:
- Tables: Leave âMigrate all tablesâŚâ selected â weâre going to migrate all tables
- Excluded Post Types: Leave this unchecked
- Advanced Options: Leave the defaults marked (replace GUIDs and exclude transients), unless these need to change for your setup
- Backup the local database before replacing it: check this, and keep âbackup all tablesâŚâ selected. This backs up your current database if you need to restore it later.
- Media Files: Check this and leave the default âcompare then downloadâ marked. You can explore the differences, but this should be fine for now since weâve just downloaded a fresh backup that has all the media files in it already.
- Save Migration Profile: check this and save your configuration, giving it a unique name (e.g. âfull PULL from PRODâ would mean that this is pulling everything from Production).
Your migration profile settings should look like this:

Once you click âPull & Saveâ the migration will run through these steps for you:
- backup your local database
- migrate the database tables from the Production environment
- compare the media files with whatâs on your Local to Production, and download anything that is new or different.
You should then see this success message:

If you get any errors, refresh the page and try again, as sometimes the first migration takes a little while and can time out.
Once the migration completes, you will be asked to log in again, but your database, media files, and code should all be on your Local environment now.
One of the benefits of using WP Migrate DB Pro are the Migration Profiles. In our example above, you only need to set up this profile once. From now on whenever you need to re-run the migration, you can click on the profile, and click âPull and Saveâ again, and your migration will run again.
Easy, peasy, lemon squeezy 🍋 😌 .
If youâd like to know about other database migration options available, Iâve listed some at the end of this article.
Step 4: Put your Local code under version control and create a remote repository
Now that you have your Local environment set up and your Production site database and media files migrated to your Local environment, itâs time to put your local code under version control. Not only will this allow you to track code changes, roll back mistakes, and and better collaborate with your team, once your code is version controlled, you can set up a deployment pipeline to automatically deploy your Local code to Production after you make changes to the files, commit them, and push them up to a remote repository.
This is very nice, no more clicking and dragging files via your SFTP client 👍 😎 .
While this guide does assume youâve used Git and version control before, we have a few recommendations and best practices to keep in mind when integrating your repository and Stratticâs platform:
- DO NOT overwrite or track your wp-config.php file! This file contains Strattic configurations, your database passwords, salts, and other configurations. It should NOT be overwritten or exposed in a repository.
- Make sure youâre using a Strattic-compatible .gitignore file:
- You should probably have the .gitignore file in the WordPress root directory (where the wp-admin, wp-content, wp-includes directories are).
- This gist is an example of how to ignore WordPress core files.
- As an alternative, this gist is more strict and will only track changes in the mu-plugins, plugins, and themes directories of your wp-content directory.
- If you are using any âmu-pluginsâ, make sure you are tracking the mu-plugins directory. If not, it can be ignored (just make sure to ignore the ludicrous directory and the strattic.php files in your .gitignore, since these should not be changed or removed).
- Only deploy code to Strattic, not your entire WordPress instance. So, for example, donât deploy files like images, PDFs, CSV, etc., unless youâre confident in what youâre doing, or thatâs your process.
The main files for version control are going to be in wp-content, which includes the mu-plugins, plugins, and themes directories. Any other code files or folders that need to be tracked can and should be added in the wp-content directory.
Since youâre deploying from a repository, make sure to follow the workflow weâre discussing for creating changes like adding posts, images, or updating styles and functionality. As described above, the best way to think about this code going âupâ from your Local environment to your Production environment, and the Production database and media files going âdownâ to your Local environment.
Again, these are all just recommendations, and you know your site and version control needs best.
If anything goes wrong, we always have a daily backup of your site which you can access in your Strattic Dashboard #safetyfirst 🤓 .
Once you have your code under version control, make sure to deploy it to a remote repository. There are many services available for this, like Github, Gitlab, Bitbucket, and more, and most have a free tier. If your organization has a self-hosted repository and requires its use, use that for your remote.
Now weâre ready to set up our deployment automation, but weâre going to give you a choice between two services we like (kinda like the âchoose your own adventureâ stories we used to read and love 🤓): Buddy and DeployHQ.
Spoiler alert!: Either option will get you where you want to go 😃⌠and you wonât be chased by a bear or fall off a cliff.
To get started with Buddy, just continue scrolling.
To get started with DeployHQ, click here.
Step 5, Option 1: Set up Buddy to deploy your Local code to the Production server
In order to deploy a code repository on Strattic, we recommend using a tool like Buddy. This allows for the repository to be deployed via SFTP. Tools like Buddy track your commits and run a script to move your code from the repository to the server.
Ok, letâs get going!
To follow along with this part of the guide, make sure you have:
- A Git repository on Github, Gitlab, Bitbucket, or self-hosted
- An account on Buddy (On the free tier, you can deploy 1 to 5 projects up to 120 times total a month!)
- Your siteâs SFTP credentials, which can be found in your Strattic Dashboard
If you havenât already, go to Buddy and create a free account. Youâll get an email to verify your email address, make sure you verify your email or you wonât be able to move on to the next step or deploy.
Already have an account? Make sure you sign in.
That was fast! Onward!
If youâve just signed up for Buddy, you were probably greeted with a âCreate a Projectâ button:

If you already have an account or got lost along the way, you can always go to your Buddy Dashboard or Projects tab and click âCreate a new projectâ.
Once you do that, youâre greeted with the following:

Add a new name for your Production site. If your repository is on one of the listed services, you can click on the service and authenticate yourself. You will then be able to choose the repository you want to integrate on Buddy.
Once you locate the repository you want to deploy, click on it. Buddy will authorize it, add its deploy keys to the repository, and then take you to the new project where you will see the option to âAdd a new pipelineâ:

Note: Buddy will automatically detect if your repository is primarily PHP (in the case of WordPress) or if youâre running a headless/decoupled WordPress setup, and your project is primarily React or Vue, youâll see something different.
Pipelines are a set of tasks performed in the context of a selected repository. To set up the pipeline, youâll need your SFTP credentials from your Strattic Dashboard. Once youâre in the dashboard, click the âDetailsâ button of the site you want to integrate.
From there, under the âConnection Infoâ tab, you can get your SFTP credentials:

Now itâs time to set up your Buddy pipeline. You should see a screen like this:

In order to set up the server youâll need to do the following:
- Name the Pipeline (something like âProduction Deploymentâ, or âDeploy to Stratticâ).
- Trigger Mode: selecting manual will require you to manually deploy from the Buddy app, or if you select âOn pushâ, code will be automatically deployed on push to that repository branch.
- Branch or tag: for now, leave as âSingle branchâ and the âmasterâ branch (or whatever your default branch is).
Now click on âadd actionâ to go to the next screen:

Click the button âTransfer files via SSH-FTPâ and enter the following:
- Keep âGitHub repositoryâ selected, unless you want artifacts on Buddy.
- Keep the âsource pathâ as is.
- âUse proxyâ can remain off.
- Under Destination Server, use the following from your Strattic Dashboard:
- âHostnameâ is the value from âSFTP Address/Hostâ.
- âPortâ is the value from âPortâ.
- âLoginâ is the value from âUser Nameâ.
- âPasswordâ is the value from âPasswordâ.
- In âRemote Pathâ, input /public_html, this assumes your repository is based in the WordPress root as mentioned above.
- Under Settings
- âDelete files on serverâ can remain On.
- âUse temporary filesâ can remain Off.
- Click âAdd this actionâ
You should be greeted with the following screen:

You can click the big, blue âRun pipelineâ button, fill out any comments you like, and then click the big blue âRun nowâ button.
This will deploy the commit/s and youâll be able to watch the progress. If there are any issues, please check your logs, reference Buddyâs Help and Support, and feel free to reach out to us as well.
Note: Depending on the size of your repository, your first deployment may take some time to complete. Subsequent deployments should go much faster and theyâre only deploying the changes you made in the code.
If you need more information, you can find help here or contact Buddy for more information.
As noted above, you can also change the setting to deploy on push to the repository. You can do this by going to the Settings in the pipeline and changing the Trigger Mode to âOn pushâ.
Otherwise, if you see a screen like this, your deployment was successful:

Congratulations!!! You have successfully deployed your website to Production!!!
🥳. 🎉. 🎊
Step 5, Option 2: Set up DeployHQ to deploy your Local code to the Production server
In order to deploy a code repository on Strattic, we recommend using a tool like DeployHQ. This allows for the repository to be deployed via SFTP. Tools like DeployHQ track your commits and run a script to move your code from the repository to the server.
Ok, letâs get going!
To follow along with this part of the guide, make sure you have:
A Git repository on Github, Gitlab, Bitbucket, or self-hosted
An account on DeployHQ (On the free tier, you can deploy 1 project up to 10 times a day!)
Your siteâs SFTP credentials, which can be found in your Strattic Dashboard
If you havenât already, go to DeployHQ and create a free account. Youâll get an email to verify your email address, make sure you verify your email or you wonât be able to move on to the next step or deploy.
Already have an account? Make sure you sign in.
That was fast! Onward!
If youâve just signed up for DeployHQ, you were probably greeted with a âCreate a Projectâ button:

If you already have an account or got lost along the way, you can always go to your DeployHQ Dashboard or Projects tab and click âCreate a Projectâ or âNew Projectâ.
Once you do that, youâre greeted with the following:

Add a new name for your Production site. If your repository is on one of the listed services, you can click on the service and authenticate yourself. You will then be able to choose the repository you want to integrate on DeployHQ.
Alternatively, if youâre self hosting your repository, or the service you use is not listed, you can check âAdd your repository details manually?â.
If you do add your repository manually, youâll be greeted with and need to add the following details to your repository and to DeployHQ:

Otherwise, you can authenticate and search for your repository

Once you locate the repository you want to deploy, click on it. DeployHQ will authorize it, add its deploy keys to the repository, and then take you to the âNew Serverâ setup.
To set up the server, youâll need your SFTP credentials from your Strattic Dashboard. Once youâre in the dashboard, click the âDetailsâ button of the site you want to integrate.
From there, under the âConnection Infoâ tab, you can get your SFTP credentials:

Now itâs time to set up your DeployHQ server. You should see a screen like this:

In order to set up the server youâll need to do the following:
- Name the Server (something like âProduction Deploymentâ).
- Click on the SSH/SFTP button.
- Under SSH Configuration, input the following from your Strattic SFTP credentials:
- âHostnameâ is the value from âSFTP Address/Hostâ.
- âPortâ is the value from âPortâ.
- âUsernameâ is the value from âUser Nameâ.
- âPasswordâ is the value from âPasswordâ.
- Leave âUse SSH key rather than password for authentication?â unchecked.
- In âDeployment Pathâ, input /public_html, this assumes your repository is based in the WordPress root as mentioned above.
- Leave the âUnlink existing file before uploading new version?â and âPerform zero-downtime deployments on this server?â boxes unchecked.
- Under Deployment Options
- Select the branch to deploy from (âmasterâ is default, but you can select any branch)
- If you would like the branch to automatically deploy when pushed to, you can check the âAutomatically deploy when this branch is pushed to?â box.
- Label the Environment whatever you like, e.g. âProductionâ.
- Unless you have a custom deployment situation, you can probably leave âSubdirectory to deploy fromâ blank.
- Under Notification Options:
- You can select when notifications should be sent. To start, we recommend âAlways Notifyâ while youâre getting comfortable with DeployHQ, otherwise you can always leave it on the âOnly notify if a deployment failsâ option.
- If you do want to receive notifications, enter your email address.
- Under User Permissions:
- Currently, you probably do not need to change this. However, if you build out multiple deployments and projects with a larger team, these options allow you to select who has permission to deploy.
Now, click âCreate Serverâ. If there are any errors, your should be able to fix them, or reach out to DeployHQâs support for help and guidance.
Once the server is created, youâre ready for deployment.
Youâll want to run your first deployment manually. The rest can be done automatically when code is pushed to whatever branch you indicated in the deployment server settings.
To make a deployment, click on âDeploymentsâ and then the âNew Deploymentâ button or âDeploy Projectâ button, either will take you to the same manual deployment screen.
From here, you will see the following:
- Deploy Limit: if youâre on the free plan, you have 10 deployments a day you can use.
- Servers: this will list the Server you set up in the last step, or any other servers you have available to deploy.
- Branch: the selected branch you want to deploy from. This can be changed if there is more than one branch.
- Start Revision: if youâve deployed before, this will show the last commit DeployHQ deployed. You can choose a different commit or enter one manually.
- End Revision: this will show the most recent commit that DeployHQ will deploy. You can choose a different commit or enter one manually.
- Schedule Deployment: this allows you to run the deployment immediately or schedule it to deploy in the future.
Once youâre satisfied with the options, you can âPreviewâ or âDeployâ.
âPreviewâ will allow you to see what will be deployed and if it will most likely succeed.
âDeployâ will deploy the commit/s and youâll be able to watch the progress. If there are any issues, please check your logs, reference DeployHQâs Help and Support, and feel free to reach out to us as well.
Note: Depending on the size of your repository, your first deployment may take some time to complete. Subsequent deployments should go much faster and theyâre only deploying the changes you made in the code.
If you need more information, you can find help here or contact DeployHQ for more information.
Congratulations!!! You have successfully deployed your website to Production!!!
🥳 🎉. 🎊
The Next Step: Make changes locally in code and deploy them automatically to your Production server
This last step is really just icing on the deployment cake.
Now that you have your Production environment ready to receive deployments and your Local environment set up to receive database and media file migrations as well as your code version controlled and connected to a remote repository, which will automatically deploy to your production environment, youâre ready to make changes to your Local codebase.
You will find example workflows next, but the idea now is that you can do the deploy the following code changes from your Local environment to Production with ease:
- Installing a new plugin or theme
- Making style changes to CSS or Sass/SCSS files
- Updating PHP template or function files
- Incorporating new JS files and functionality
All of these code changes can be made locally, committed, pushed to your remote repository, and automatically deployed to your Production environment with just a few clicks or console commands.
Now, letâs put it all together.
Example 1: Workflow on Strattic with a new site:
- Develop Locally
- Deploy to Production
- Publish to Live static site
This assumes youâve got your website set up on a Local environment how you like it.
- Put your Local codebase under version control and set up a repository on your host of choice (e.g. Gitlab, Github, Bitbucket, etc.).
- If youâre using Migrate DB Pro and the Media Files add-on, make sure itâs in your codebase and in version control.
- Set up your deployment to Strattic with Buddy or DeployHQ.
- Deploy your code to Strattic. Now your Local code should be on Stratticâs Production environment.
- Set up your Migrate DB Pro connection between your Local and Production environments.
- Push your database and media files from Local to Production. Migrate DB Pro handles the search and replace, serialized data, and flushes the cache and permalinks.
- Your Local site should now be on Production, and you should be able to click on the Strattic Publish to generate the static version of your site.
Example 2: Workflow on Strattic to update a site:
- Get Backup from Production
- Develop Locally
- Deploy to Production
- Publish to Live static site
This assumes youâve got your website set up on Stratticâs Production environment, your code is not yet under version control, and you want to set up a new local environment to make changes and deploy those changes back to Strattic.
- If youâre using Migrate DB Pro and the Media Files add-on, make sure itâs in your Production codebase.
- Backup your site on Strattic and download the codebase, database, and media files (i.e., the entire zip).
- Bring that code into your fresh Local setup, however you normally do.
- Set up your Migrate DB Pro connection to be your Local and Production environments.
- Pull your database and media files from Production to Local. Migrate DB Pro handles the search and replace, serialized data, and flushes the cache and permalinks.
- Put your Local code under version control.
- Set up your deployment to Strattic with Buddy or DeployHQ.
- Deploy your code to Strattic. Now your Local code should be on Stratticâs Production environment (and in this case, nothing has actually changed, because it was the code that was already there, the only difference is that now itâs all version controlled).
- Make any code changes you like, commit them, and push them to your Git repo, which can automatically deploy them to Strattic if you have that set up.
- Push your database and media files from Local to Production. As before, Migrate DB Pro handles the search and replace, serialized data, and flushes the cache and permalinks.
- Your Local site should now be on Production, and you should be able to click on the Strattic Publish to generate the static version of your site.
Example 3: On Using Multiple Environments:
- Local
- A Development Environment on or off Strattic
- Stratticâs Production
- Publish to Live statice site
Letâs say youâre in a situation where you have a dev team that normally tests their work locally, but sometimes use a hosted Development environment to show some experimental work or get another person to QA / UAT. You also try to keep Development identical to Stratticâs Production so it can be used to test deploys and configuration issues. What do you do here?
Use the previous examples to make sure that your codebase is under version control and Migrate DB Pro is set up on all environments.
Make sure youâre using a good Git workflow, there are several options like Github flow, feature branching, and the Nvie model. Letâs assume though your production branch is main and your development branch is develop and all feature branches merge into develop.
- Set up the Development environment as a mirror of Production.
- Developers make their changes via feature branches and those get merged into develop which gets deployed to the Development environment.
- Developers or content administrators can then make their test changes on the Development environment, and QA/UAT those changes.
- Then, if all is well, the code can be merged into main , which can then be deployed to Stratticâs Production environment.
- The updates can be made there as well, tested again, and then everything can be published to Live.
- Critical Note: even though youâre able to migrate databases, in this case, you should never migrate a database from Development to Production as you will lose Live data (forms, comments, anything else that is integrated to your Production environment with Strattic). Of course, you can always migrate from Development to Production if youâre confident in your workflow, and thereâs nothing dynamic on your Production environment you are worried about losing (i.e., youâve got a âread onlyâ site with no contact forms, comments, etc.).
Aaaand thatâs a wrap
We hope this guide has been helpful and shown you a path for yourself or your team to create a workflow and deployment system that works for you on Strattic or anywhere else you choose to host your site.
While this guide focused on one way to run a workflow and deployment system for your WordPress project, there are many ways and tools available to create your or your teamâs ideal workflow. For example, CodeShip and BranchCI could be used for deployments instead of Buddy or DeployHQ, and WP-CLI or the InterconnectIT Search and Replace plugin to update your database export on Local. Weâve tried to pick out the tools in this guide that are reliable, user friendly, and remember your deployment settings for the next deploy. Feel free to test other tools and adjust your workflow to your needs accordingly .
As always, weâre here to help and available if you have any questions, please feel free to reach out and ask!