2

I'm developing a business website with Drupal 7 that is currently running on a server at my home so that I can just upload everything to my VPS when it is all ready. I'm only a solo developer so I don't have the resources to have a production/staging site and different stages etc., but I do anticipate that there will be a time when this might happen and there will definitely be times when I need to do a major update on the website. So is there a way I can make changes to content, themes and modules on my server at home, and then once I'm happy 'synchronize' the changes with the actual website so that I don't have to keep putting the site in maintenance mode for long periods of time.

I can't just simply re-upload the site everytime though because it is an e-commerce site so hopefully orders will be flowing and there would be new user accounts since I pulled the database so that I could work on the website etc.

Hope that makes sense

1
  • 1
    Could someone supply a list of techniques. I've tested with xampp(slow), wamp(Too complex for multi sites, drush(not intended for windows) and currently webmatrix(easiest) in my experience. Used with backup migrate to upload and download the sites
    – sasdev
    Commented Aug 24, 2013 at 16:26

1 Answer 1

1

This is a very long topic to cover fully so I will just push you to the right direction to get things rolling and save you from lot of trouble.

You should never sync your local db to production db after you have first installed the site to production environment. The sync process of db is always one way: production -> staging -> local environment. Also when syncing the db from production you should always sanitize the sensitive data (user emails and passwords) for example with Drush sql-sync --sanitize option (yes you can have Drush for Windows too). To able to use this kind of workflow you need to have the configuration of modules, views etc. in code not in db. In Drupal 7 you can use modules like features to achieve this. In Drupal 8 most of this will be covered with cores built-in configuration management. Of course on top of everything you need to use version control system to not go nuts when developing the site. Services like Bitbucket, GitHub and GitLab give you the needed tools and ge you going with VCS in no time. With version control you can compare different versions of code, fall back easily to previous versions in your code and easily take more collaborators in the mix in the future. Doing any size of development without version control system is just plain stupid.

If you can't afford to have a staging environment on a VPS you should use your local environment wisely. Having your local environment as close as possible to the production environment is a wise thing to do in any circumstance. Use a virtualization product like Virtualbox and install the exact same setup on your local computer than you have on your production. When managing several production environments tools like Vagrant, Chef and Puppet can help you to keep configurations in sync and make your life easier :)

Things you should also remember is to have regular automated backups of your production data, know how to fall back to previous versions of code, configuration and db if something fails and to treat production environment always as a production environment. Remembering all of this makes your life a lot easier :)

7
  • Sorry for the delayed reply and thank you for your answer. Just to clarify, the sync should only be one way and never to the live site; instead I need to use modules to be able to get the new content and settings to the live site? If so, is it possible for to provide a list of modules I'll need seeing as though I won't be upgrading to Drupal 8 for a while? With regards to the local environment though, I have already ensured that it is almost identical to the VPS.
    – Andy
    Commented Aug 27, 2013 at 18:16
  • Also, I don't quite understand how VCS can be used with Drupal
    – Andy
    Commented Aug 27, 2013 at 18:19
  • VCS here means Version Control System like Git, SVN or similar. I recommend using Git because drupal.org is using Git. Help in using Git with Drupal can be found from here git-scm.com/book, drupal.org/node/1013552 and drupal.org/node/803746. For keeping the configurations in code you can use either Features (drupal.org/project/features and drupal.org/node/580026) or Configuration (drupal.org/project/configuration) module.
    – iler
    Commented Aug 28, 2013 at 12:06
  • Thank you for the links regarding VCS, I will check them out - they should be very helpful. Just to check, Features will allow me to synchronise my modules, nodes, and settings between the two sites?
    – Andy
    Commented Aug 28, 2013 at 13:24
  • 1
    Features will handle exporting of settings, views, content types to code. Then you will have Drupal codebase (core and contrib modules) in the repository together with Features exports. To start using Features I recommend reading this documentation drupal.org/node/580026. Then you have everything but content in code so it's easy to diff the changes.
    – iler
    Commented Aug 28, 2013 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.