What's best Drupal deployment strategy? [close

2019-01-20 22:11发布

I am working on my first Drupal project on XAMPP in my MacBook. It's a prototype and receives positive feedback from my client.

I am going to deploy the project on a Linux VPS two weeks later. Is there a better way than 're-do'ing everything on the server from scratch?

  • install Drupal
  • download modules (CCK, Views, Date, Calendar)
  • create the Contents
  • ...

Thanks

9条回答
对你真心纯属浪费
2楼-- · 2019-01-20 23:08

We use the Features module extensively to capture features and then install them easily at the production site.

查看更多
等我变得足够好
3楼-- · 2019-01-20 23:09

Any version control system (GIT, SVN) + Features module to deploy Drupal code + custom settings (content types, custom fields, module dependencies, views etc.).

As Deploy module is still in development mode, so you may like to use Node export module in Drupal 7 to deploy your content / nodes.

查看更多
孤傲高冷的网名
4楼-- · 2019-01-20 23:11

We've had an extensive discussion on this at my workplace, and the way we finally settled on was pushing code updates (including modules and themes) from development to staging to production. We're using Subversion for this, and it's working well so far.

What's particularly important is that you automate a process for pushing the database back from production, so that your developers can keep their copies of the database as close to production as possible. In a mission-critical environment, you want to be absolutely certain a module update isn't going to hose your database. The process we use is as follows:

  1. Install a module on the development server.
  2. Take note of whatever changes and updates were necessary. If there are any hitches, revert and do again until you have a solid, error-free process.
  3. Test your changes! Repeat your testing process as a normal, logged-in user, and again as an anonymous user.
  4. If the update process involved anything other than running update.php, then write a script to do it.
  5. Copy the production database to your staging server, and perform the same steps immediately. If it fails, diagnose the failure and return to step 1. Otherwise, continue.
  6. Test your changes!
  7. BACK UP YOUR PRODUCTION DATABASE and TAKE NOTE OF THE REVISION YOU HAVE CHECKED OUT FROM SVN.
  8. Put your production Drupal in maintenance mode, run "svn update" on your production tree, and go through your update process.
  9. Take Drupal out of maintenance mode and test everything (as admin, regular user, and anonymous)

And that's it. One thing you can never really expect for a community framework such as Drupal is to be able to move your database from testing to production after you go live. From then on, all database moves are from production to testing, which complicates the deployment process somewhat. Be careful! :)

查看更多
登录 后发表回答