Post by andyd92 » Mon May 25, 2015 6:25 pm

Hi all

I have recently site up a site mirror / duplicate of a Opencart 2.0.1.1 store for testing purposes on a sub-domain.

Now I was wondering if there is anyway I can get the mirror site to pull in orders as and when they come in. That is, both the original site and mirror site are functioning exactly the same with orders flowing in as and when.

The reason for this is that I need to test some changes which effect the funtionality of the ordering system, which I cannot test without live orders coming in, obviously I cannot test on a live site incase I break it, which is likely :o)

Any suggestions greatly appreciated?

Thanks in advance

New member

Posts

Joined
Tue Dec 11, 2012 1:50 am

Post by viethemes » Mon May 25, 2015 9:33 pm

You can try to use the Backup/Restore tool of OpenCart 2 to copy data between two stores.

http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension

Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme

Extra Positions PRO, Custom JavaScript, Custom CSS and others


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm


Post by deepvision » Mon May 25, 2015 9:41 pm

In the second database instead of creating a table for orders create a VIEW like this:

Code: Select all

CREATE ALGORITHM=MERGE VIEW test_database.order AS SELECT * FROM live_database.order;

ImageImageImage


User avatar
Active Member

Posts

Joined
Tue May 19, 2015 1:03 am

Post by andyd92 » Tue May 26, 2015 9:02 pm

Hi Deepvision

Thanks for the response. That sounds like that could work. Could you provide a little more detail.

Which table do I need to edit? How do i direct copy database to view live database?

Sorry my knowledge of mysql is limited to say the least.

Thanks

Andy

New member

Posts

Joined
Tue Dec 11, 2012 1:50 am

Post by deepvision » Wed May 27, 2015 12:46 am

Andy.

The code already contains the proper table name which is 'order'.
All you have to do is to replace the test_database with your test database name and the live_database with your live database name in the code. Also before running the code you'll have to drop the order table on the test database.
Please note that this solution is only for one "order" table. I am not sure but you might want to sync some other related tables. Like order history or order products. It might take awhile to figure it out which tables exactly you'll need.
Also obviously the test database won't be able to accept its of own orders.
Im on mobile now, can provide more details when I'm at my desk.

ImageImageImage


User avatar
Active Member

Posts

Joined
Tue May 19, 2015 1:03 am

Post by andyd92 » Wed May 27, 2015 2:12 pm

Hi Deepvision

Thanks for your reply.

Basically what I'm trying to do is get the ordering part of the DB to function the same as the live site. So I can see what happens when I make some changes.

Kind regards

Andy

New member

Posts

Joined
Tue Dec 11, 2012 1:50 am

Post by deepvision » Wed May 27, 2015 6:49 pm

Andy

Would you try it and get back to me?

ImageImageImage


User avatar
Active Member

Posts

Joined
Tue May 19, 2015 1:03 am
Who is online

Users browsing this forum: No registered users and 11 guests