Reputation: 3
I am developing a Magento site. I have access to a local host and a remote host and would like to somehow configure development and production environments. On the remote host I restore the database data that was backed up on the local host, but when I do so, I overwrite the host's base name and this causes the site to be redirected to a nonexistent URL when the page is loaded. How can I avoid this clash:
I want to be able to develop either (a) on http:// remotehost/foobardev and back up my data to http:// remotehost/foobar or otherwise (b) develop on http:// localhost/foobar and deploy on http:// remotehost/foobar . I want to know how to transfer the database data back and forth without overwriting the values found in Magento Admin Panel -> System -> Configuration -> Web -> Unsecure Base URL / Secure Base URL when I run mysql and use the mysql command source to reinstate the database entries found on the development site onto the production site.
So, I would like an easier way to restore the database contents without overwriting the base url configured in magento admin panel as doing so would cause a redirect to a nonexisting or wrong place on each page load and thus render the system unusable.
Upvotes: 0
Views: 851
Reputation: 12750
Not exactly a SO type of question. Magento EE has staging built in and can merge your data as well. You have to understand that syncing data from dev to live is not easily possible without some serious sync framework that keeps track on state of every row and column and knows what data is new and what is old and solve syncing conflicts.
Here's your flow based on assumption that you are using CE and does not have data migration tools bundled.
Same goes about code and here's a common setup scenario with live, stage and development environments
so to visualise it better imagine your codebase residing in git.
myproject_magento_se (your project git repository on bitbucket.org or in github or wherever you can host)
--> master (branch with all clean magento versions from your current to latest)
--> dev (git checkout -b master (or by specific version from master)
--> stage (while on dev: git checkout -b stage)
--> live (while on stage: git checkout -b live)
and imagine your hosts setup like this:
www.mylivesite.com = git clone yourgitrepo; git checkout live;
stage.mylivesite.com = git clone yourgitrepo; git checkout stage;
dev.mylivesite.com = git clone yourgitrepo; git checkout dev;
For all this you better have deployment scripts that do switching and code and database lifting between environments with a push of the button.
Here's a few common actions that you need to perform daily with every software project
have fun :) and go through this thread as well https://superuser.com/questions/90301/sync-two-mysql-databases and all other you can find searching on SO in similar matter.
Upvotes: 2