I have a local development Drupal site using WAMP to build. I moved it over to Bluehost successfully. But now I would like a process to regularly update my remote site with local changes I'm making. I know this is a common issue but I'm hoping an expert here could provide me with some best practices. I tried doing an update myself, these were my steps and the complications that arose. Failure is the best learning opportunity right?

I exported the db from both the local and remote mysql. Then I saved a copy of the remote 'sites' folder. Then I made sure to switch my settings.php file to use the remote db creds. Then I just moved the entire Sites folder from local to remote. That worked fine.

Moving the db was the challenge. Keep in mind there is nothing happening on the remote server yet because no one is using it, it's still in development. For now, I don't have to worry about syncing changes. So I tried just importing my local sql file...but got the following error:

-- -- Dumping data for table dr_accesslog -- INSERT INTO dr_accesslog (aid, sid, title, path, url, hostname, uid, timer, timestamp) VALUES (6707, 'P5lbV-jGxB54nNQw_zIkbYyHQK1OaWADg5Vy7yXqjT4', '', 'node', '', '', 1, 193, 1421403472), (6708, 'P5lbV-jGxB54nNQw_zIkbYyHQK1OaWADg5Vy7yXqjT4', '', 'node', '', '', 1, 194, 1421404545), (6709, 'P5lbV-jGxB54nNQw_zIkbYyHQK1OaWADg5Vy7yXqjT4', '', 'node', '', '', 1, 196, 1421404551), (6710, 'P5lbV-jGxB54nNQw_zIkbYyHQK1OaWADg5Vy7yXqjT4', '', 'node', '', '', 1, 191, 1421404617), (6711, 'rpjGdoYWValMQ7BG7ZaOmQsp2qfLGdgfhyJ9VvZDbzk', '', 'node', '', '', 0, 211, 1421407113), (6712, 'Q2i-LExlMQC5xFRmnX4lZ9hzpbM1ON9hti9ZwR_9NJQ', 'About Sage', 'node/1', '', '', 0, 180, 1421407713), (6713, 'vRW3zsgiUNX3xStP83tnKYxTlovWOipVuJ3tG3JfCB8', 'Tutorials', 'tutorials', '', '', 0, 254, 1421408230), (6714, 'M-QkySdvAY9L_k9825ZDAjHl5sQ308saGYl5qz4BvM[...]

MySQL said: Documentation

1062 - Duplicate entry '6764' for key 'PRIMARY'

Yikes. Not sure how this is happening. A duplicate primary key it looks like but if I'm overriding the entire db I'm not sure how this can happen.

At any rate, I just deleted the remote db entirely and re-created it, and THEN did the import of my local file. This STILL caused the error somehow, but now the site works just as if the import had worked successfully.

Then I had to change (ie. just remove the tmp files directory in config - otherwise it kept giving me an error about that) and turn on clean URLs again.

Wow. What a messy process! Can someone please recommend another workflow for me that's not so complicated and time consuming? Or is this just how it is...

I'd like to have one for now while I'm still doing development...and another for after I go live when I need to sync my changes.


  • Take a look at this: acquia.com/blog/using-git-drush-win-workflow – 2pha Jan 20 '15 at 8:48
  • This is an elegant solution but I've tried setting this up before with my server and can't figure out how to setup the drush alias file to access my server even though I'm able to get SSH running independently and even installed drush on my hosted server. My hosting provider wasn't able to provide much guidance beyond, well SSH appears to be working so what's the problem? shrug; they had never heard of drush aliases... – Sage Jan 20 '15 at 9:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.