I am new to Drupal and have a synchronization question.
I just installed Drupal on my domain at the ISP server without problems. Because I want to do the development locally and then update the website I copied all files on the server to my local machine.
Locally I run WAMP, Apache and MySQL.
I exported the server database and created the same content on my own machine running WAMP and MySQL. Locally I now see the same content as on the server. I go to my site at localhost/mywebsite.

Having said all that, the big question is: What to do when I want to update the site on the server? Do I copy all local files back to the server and also the content of the database or am I missing info when doing that? Just wonder about Templates, modules etc I install locally. Will these be active when doing the update as described?

Your responses are appreciated.



Jaypan’s picture

There are essentially two parts to a Drupal site:

1) The file system
2) The database

These work with each other and depend upon each other.

When you move from one server to another (ie remote -> local or local -> remote), you need to copy both the filesystem as well as the database over. HOWEVER, it's not easy to only copy parts of the database over, it's basically an all-or-nothing situation. You can get around this by using the Features module, which will allow you to move database information between installations, without copying the whole database over. You can also use the Backup and Migrate module to export and move entire databases over from one server to another.

Usually our process at Jaypan is to do the following:

1) Create a site locally
2) Move the file system to the server (we use GIT, but you can use FTP, SVN or whatever method you'd like)
3) Use the backup and migrate module to move the local database to the server

However, at this point, since we have multiple people working on the site at the same time, the remote server essentially becomes our 'master' database. So at the start of every day, we pull the remote database to our local installations. We do this using drush, with drush-aliases, using drush sql-sync. This pulls the entire remote database to our local machine. Then, as we develop, if anything in needs to be done in particular on the remote server, we manually change it on the remote server. Then on our next sql-sync, we get that new information on our local machines.

Checkout my Japan podcasts.
Sydo’s picture

Thanks Jaypan,

Your answer is what I was looking for. Was looking for confirmation that I did not miss out on any information the way I suggested.
Currently I am the only one working on the database. I will setup a certain schedule if more people will work on it.
With the MySQL my ISP has I can create a .sql file that contains all DB structures and content. This file can be used as a script on my local system.
File system will be transferred via an FTP connection.

With point 3) Backup and migration module, I assume you mean a module within Drupal and not MySql.

Looks like the plan will work.

Once again thanks for your reply, highly appreciated.


Jaypan’s picture

The backup and Migrate module is a Drupal module. You install Drupal normally on your remote server, then use that module to import a backup that you export from your local.

Checkout my Japan podcasts.
Sydo’s picture

Cheers. That´s all.

Thanks a bundle.