<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.apoyar.eu/index.php?action=history&amp;feed=atom&amp;title=Zeb_Live_DB_Restore_Task</id>
	<title>Zeb Live DB Restore Task - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.apoyar.eu/index.php?action=history&amp;feed=atom&amp;title=Zeb_Live_DB_Restore_Task"/>
	<link rel="alternate" type="text/html" href="https://wiki.apoyar.eu/index.php?title=Zeb_Live_DB_Restore_Task&amp;action=history"/>
	<updated>2026-07-20T13:59:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.apoyar.eu/index.php?title=Zeb_Live_DB_Restore_Task&amp;diff=150&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;Zeb Live db restore task to zeb uat instance followed by below steps -------------------------------------------------------------------    First we need connect AWS---&gt; URL i...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.apoyar.eu/index.php?title=Zeb_Live_DB_Restore_Task&amp;diff=150&amp;oldid=prev"/>
		<updated>2021-01-19T10:04:47Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Zeb Live db restore task to zeb uat instance followed by below steps -------------------------------------------------------------------    First we need connect AWS---&amp;gt; URL i...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Zeb Live db restore task to zeb uat instance followed by below steps&lt;br /&gt;
------------------------------------------------------------------- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First we need connect AWS---&amp;gt; URL is&lt;br /&gt;
&lt;br /&gt;
https://eu-west-1.console.aws.amazon.com/&lt;br /&gt;
&lt;br /&gt;
Goto--&amp;gt; RDS---&amp;gt;Databases&lt;br /&gt;
&lt;br /&gt;
1. RDS instance restore from last night automated backup file.&lt;br /&gt;
&lt;br /&gt;
Goto Automated Backups---&amp;gt; Select zeb-db---&amp;gt; Under System Snapshots--&amp;gt; Select yesterday Snapshot(its created everyday 19.10(zeb time))---&amp;gt; Actions---&amp;gt;  Restore Snapshot---&amp;gt; New Instace creating( DB Instance class---&amp;gt; db.m4.large, DB Instance Identifier---&amp;gt; db-live-restore,  Public accessability ---&amp;gt; Yes, VPC security Groups---&amp;gt; Choose Existing---&amp;gt; MYSQL , MYSQL External, Default, Subnet-a,  DB parameter group---&amp;gt; zeb-mysql-new)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Connect new RDS instance from zeb uat instance using host name &amp;amp; user name &amp;amp; password details as below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
hostname: zeb-db.-newc0fntifenc9y.eu-west-1.rds.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
user: zebdbmaster&lt;br /&gt;
&lt;br /&gt;
pwd: busawove95&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Goto mobXterm---&amp;gt; Connect to uat.zeb.apoyar---&amp;gt; run below command&lt;br /&gt;
&lt;br /&gt;
mysql -hzeb-live-restore.c0fntifenc9y.eu-west-1.rds.amazonaws.com -u zebdbmaster -p&lt;br /&gt;
&lt;br /&gt;
show databses;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. check the live db name ( zeb) as i verified on live magento zeb sever&lt;br /&gt;
&lt;br /&gt;
---&amp;gt;Connect to magento.zeb.apoyar----&amp;gt; run below command &amp;amp; One file opened&lt;br /&gt;
&lt;br /&gt;
vim /var/www/html/migration/app/etc/env.php&lt;br /&gt;
&lt;br /&gt;
in that file copy crendials &lt;br /&gt;
&lt;br /&gt;
&amp;#039;host&amp;#039; =&amp;gt; &amp;#039;zeb-db.c0fntifenc9y.eu-west-1.rds.amazonaws.com&amp;#039;,&lt;br /&gt;
&lt;br /&gt;
                &amp;#039;dbname&amp;#039; =&amp;gt; &amp;#039;zeb&amp;#039;,&lt;br /&gt;
&lt;br /&gt;
                &amp;#039;username&amp;#039; =&amp;gt; &amp;#039;zeb&amp;#039;,&lt;br /&gt;
&lt;br /&gt;
                &amp;#039;password&amp;#039; =&amp;gt; &amp;#039;PPdD%t5-$qT4aD&amp;#039;,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. export the database file into .sql file like zeb_uat_jan21.sql&lt;br /&gt;
&lt;br /&gt;
---&amp;gt; Again go to uat.zeb.apoyar&lt;br /&gt;
&lt;br /&gt;
export the database by using below command&lt;br /&gt;
&lt;br /&gt;
mysqldump -hzeb-live-restore.c0fntifenc9y.eu-west-1.rds.amazonaws.com -u zebdbmaster -p &amp;gt; zeb_uat_jan21&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if we need check export is running or not ---&amp;gt; Open new terminal of uat.zeb.apoyar---&amp;gt; ls-ltrah&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Once export finished stop Rds instance ( ze-live-restore or delete it completely)&lt;br /&gt;
&lt;br /&gt;
Right Click on Instance---&amp;gt; Stop the Service and delete it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Compress sql file into zp file&lt;br /&gt;
&lt;br /&gt;
using this command ----&amp;gt;   sudo tar cvzf zeb_uat_jan21.tar.gz zeb_uat_jan21.sql&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. remove tags and stored procedures from sql dump file using this command&lt;br /&gt;
&lt;br /&gt;
sudo perl -pe &amp;#039;s/\sDEFINER=[^]+@[^]+//&amp;#039; &amp;lt; zeb_uat_jan21.sql &amp;gt; zeb_uat_jan21.fixed.sql&lt;br /&gt;
                              and&lt;br /&gt;
sudo perl -pi -e &amp;#039;s#\/\*\!5001[7|3].*?`[^\*]*\*\/##g&amp;#039; zeb_uat_jan21.fixed.sql&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8.  Connect Zeb uat RDS instance by using command below &lt;br /&gt;
&lt;br /&gt;
---&amp;gt; mysql -hzeb-db-new.c0fntifenc9y.eu-west-1.rds.amazonaws.com -u zebdbmaster -p&lt;br /&gt;
  &lt;br /&gt;
Mysql&amp;gt; create database zeb_uat_jan21;&lt;br /&gt;
&lt;br /&gt;
Mysql&amp;gt; show databases;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
09. Database import command:&lt;br /&gt;
&lt;br /&gt;
mysql -hzeb-db-new.c0fntifenc9y.eu-west-1.rds.amazonaws.com -u zebdbmaster -p  zeb_uat_jan21 &amp;lt; zeb_uat_jan21.fixed.sql&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10.  You can open new terminal and check show tables command how many tables importing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: Better to run import command on any of remote desktop server i used devops.apoyar and connected uat.zeb.apoyar server through putty and started importing to avoid disconnection internet it will stop command once import is finished without any error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Errors:&lt;br /&gt;
&lt;br /&gt;
7th step runnig import command it will occur below error to fix this run ( sudo perl -pi -e &amp;#039;s#\/\*\!5001[7|3].*?`[^\*]*\*\/##g&amp;#039; zeb_uat_jan21.fixed.sql)&lt;br /&gt;
ERROR 1064 (42000) at line 1658: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &amp;#039;@`172.31.0.80`*/ /*!50003 TRIGGER update_visit_stat AFTER INSERT ON amasty_faq_v&amp;#039; at line 1&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>