Roots Discourse

Best practise to handle a 'Down for maintenance' page when running the sync script?

Hi guys,

I use the WP Maintenance Mode plugin which is a very handy plugin. I use the roots sync script when syncing DB and uploads changes (again, a great little script). The issue is when it’s resetting the DB it obviously breaks the site as it cannot connect to the DB. Depending on how big the DB is, sometimes it lasts for several seconds and it’s obviously not great if someone is on the site at that time. The WP Maintenance Mode plugin is no use during this time because it requires the DB. I’m curious how you guys handle this? I’m using the full roots stack FYI.

Thanks,
Aaron

I assume you’re pushing your local DB to staging or production?
If so, I’d say most people avoid the issue that you have completely because a lot of us would not recommended to ever push database changes up.

One thing you could do, though, would be to serve a static HTML during your sync.

Hey codepuncher,

Yes, I’m aware it’s not best practise to push DB changes up. My only scenario is if I’m working on a new feature locally that really needs some DB changes, I’ll pull the latest locally from production, I will put the live site in maintenance mode using WP Maintenance Mode plugin so nothing on the live site can get out of sync (such as a new user signing up, or a new post being made). I’m aware I can just add a static index.html, I was just curious to see how others managed that.

Thanks anyway.

Cheers,
Aaron

This topic was automatically closed after 42 days. New replies are no longer allowed.