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
timestamp) VALUES (6707, 'P5lbV-jGxB54nNQw_zIkbYyHQK1OaWADg5Vy7yXqjT4', '', 'node', '', '126.96.36.199', 1, 193, 1421403472), (6708, 'P5lbV-jGxB54nNQw_zIkbYyHQK1OaWADg5Vy7yXqjT4', '', 'node', '', '188.8.131.52', 1, 194, 1421404545), (6709, 'P5lbV-jGxB54nNQw_zIkbYyHQK1OaWADg5Vy7yXqjT4', '', 'node', '', '184.108.40.206', 1, 196, 1421404551), (6710, 'P5lbV-jGxB54nNQw_zIkbYyHQK1OaWADg5Vy7yXqjT4', '', 'node', '', '220.127.116.11', 1, 191, 1421404617), (6711, 'rpjGdoYWValMQ7BG7ZaOmQsp2qfLGdgfhyJ9VvZDbzk', '', 'node', '', '18.104.22.168', 0, 211, 1421407113), (6712, 'Q2i-LExlMQC5xFRmnX4lZ9hzpbM1ON9hti9ZwR_9NJQ', 'About Sage', 'node/1', '', '22.214.171.124', 0, 180, 1421407713), (6713, 'vRW3zsgiUNX3xStP83tnKYxTlovWOipVuJ3tG3JfCB8', 'Tutorials', 'tutorials', '', '126.96.36.199', 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.