Post by JeepSWAG » Mon Jun 08, 2020 12:15 am

OC experts, please review and comment.

I've got a lot of from this community and I think I found a way to contribute something.

I needed to make a gold copy of my zones, geo zones and countries, that I would be able to import when I do a new install of OC. Here is what I've come up with and I it looks like it works. I'd welcome process reviews and feedback by OC developers.

I am not a developer and do not have the ability to thoroughly test this. As always backup before doing this and do it at your own risk.

In source store;
1. Delete all zones, geo zones and countries that I would not be using, in order to create a gold list.
2. System>Maintenance>Backup/Restore - Unselect all then Select the following (your database names may be different);
- ocxx_country
- ocxx_geo_zone
- ocxx_zone
- ocxx_zone_to_geo_zone
3. Click export and save the file

In Target store
1. System>Maintenance>Backup/Restore - Unselect all then Select the following ;
- ocyy_country
2. Click export and save the file

With Notepad++
1. Edit the target store and determine the database name. In the above example you will see ocyy
2. Edit the source store and Replace <Ctrl-H> all instances of the database name (in our example above ocxx) with the database name of target store (in our example above ocyy).

Example of what it starts as and becomes;

Source Store;

Code: Select all

TRUNCATE TABLE `ocxx_country`;

INSERT INTO `ocxx_country` (`country_id`, `name`, ...
INSERT INTO `ocxx_country` (`country_id`, `name`, ...
INSERT INTO `ocxx_country` (`country_id`...
WILL BECOME

Target Store;

Code: Select all

TRUNCATE TABLE `ocyy_country`;

INSERT INTO `ocyy_country` (`country_id`, `name`, ...
INSERT INTO `ocyy_country` (`country_id`, `name`, ...
INSERT INTO `ocyy_country` (`country_id`...
3. Save this file as zonesgold.sql

In the Target store;
1. System>Maintenance>Backup/Restore <Restore>
2. Import the zonesgold.sql file and check your work.
Last edited by JeepSWAG on Mon Jun 08, 2020 12:21 am, edited 3 times in total.

Newbie

Posts

Joined
Fri Jul 13, 2012 1:16 pm

Post by straightlight » Mon Jun 08, 2020 12:16 am

This topic has now been moved to the OpenCart 3.0 Support > General Support section of the forum.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by sw!tch » Mon Jun 08, 2020 4:58 am

Built in backup restore is terrible IMO. You can easily do the export / import with PHPmyAdmin less chance for error. The rest of your logic is fine otherwise.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by JeepSWAG » Wed Jun 10, 2020 9:08 am

Thanks for reading through the first post.
Is the built in backup not very reliable? I'm planning on moving one of my sites soon and was going to use the backup and restore.
If someone would give me the basic steps to do this via PHPmyAdmin, I'd be happy to idiot proof it (make it so easy that I can even do it...)

sw!tch wrote:
Mon Jun 08, 2020 4:58 am
Built in backup restore is terrible IMO. You can easily do the export / import with PHPmyAdmin less chance for error. The rest of your logic is fine otherwise.

Newbie

Posts

Joined
Fri Jul 13, 2012 1:16 pm
Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 10 guests