Jump to content

Development environment and DB synchronization


Mtoro
 Share

Recommended Posts

Hello everyone,

I’m new to ProcessWire because I started a new job where they use PW as their CMS of choice. I have already read the documentation and have a basic understanding of the framework. Currently, in my job, we mainly use FTP for the production environment, so whenever I need to make a change, I do it directly on the "cloudfiles" and test them on the live webpage. (This is very risky, and I'm not too comfortable with it.)

The problem they mentioned is the synchronization of the data stored in the database. Do you have any recommendations to solve this problem? Thanks in advance!

(We use MySQL for the database.)

Link to comment
Share on other sites

4 hours ago, bernhard said:

Hello and welcome to ProcessWire 🙂 

Seems you are lucky - this is my setup that I just shared 4 days ago:

 

OMG, thanks! Perfect timing. I'll have a look and tell my superiors about it. The team is very used to PW, so I really don't want to change it.

  • Like 1
Link to comment
Share on other sites

Hi Mtoro,

Quote

The team is very used to PW, so I really don't want to change it.

And you shouldn’t... Once you are used to it, PW is so much better than anything else... 😊

I’ll share what I do (it’s not as "pro" as Bernhard solution, but it fits my needs and it’s simple).
The good point is that PW database is not URL dependant. So you can dump it from the prod server, and import it on your local server, it will work as it is.

When I have to do some modifications on a website that may receive some update when I work (like an order on an online store, or a contact form that has been sent), I do the following :
download the DB from the prod and import it on local.

  • use rsync to synchronize files from prod to local (I don’t synchronize the files in the site/assets/cache folder, nor the ones in the site/assets/sessions).
  • modify the files that need it. If it involves some new fields or templates, I create them on the prod admin and export/import DB again on the local server.
  • check if everything’s work well
  • with FTP, update the files that have been modified (pushing with rsync may erase some new files on the prod version).

As I said, it worths what it worths, but it works well.

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...