{"id":474,"date":"2020-06-13T19:54:11","date_gmt":"2020-06-13T19:54:11","guid":{"rendered":"http:\/\/www.legendshub.com\/blog\/?p=474"},"modified":"2020-06-14T21:12:12","modified_gmt":"2020-06-14T21:12:12","slug":"restoring-word-press-site-into-aws-ec2-instance-legendshub-blog","status":"publish","type":"post","link":"https:\/\/www.legendshub.com\/blog\/2020\/06\/13\/restoring-word-press-site-into-aws-ec2-instance-legendshub-blog\/","title":{"rendered":"Restoring word press site into AWS EC2 instance &#8211; Legendshub Blog"},"content":{"rendered":"\n<!-- Quick Adsense WordPress Plugin: http:\/\/quickadsense.com\/ -->\n<div class=\"2c935cf620b701aabbb7cc90bbf4023c\" data-index=\"1\" style=\"float: none; margin:0px 0 0px 0; text-align:center;\">\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<script>\r\n  (adsbygoogle = window.adsbygoogle || []).push({\r\n    google_ad_client: \"ca-pub-5554449970657557\",\r\n    enable_page_level_ads: true\r\n  });\r\n<\/script>\n<\/div>\n\n<p>Today we will discuss about restoring word press website backup step by step.<\/p>\n\n\n\n<p>Existing Landscape: WordPress website is running on Go daddy.<\/p>\n\n\n\n<p>Steps to Restore:<\/p>\n\n\n\n<p>1.) Mostly backup policy depends on rate of content change for the website. Generally speaking it is good practice to have one weekly full backup. In our case we will configure free backup plugin for full backup and redirect backup copy to drop box.<\/p>\n\n\n\n<p>I will have backup placed as a zip in drop box. The good thing with drop box is that it provide user with shareable link which can be unzipped manually on destination instance or can be scripted as well.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"88\" src=\"http:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/Maases-1024x88.png\" alt=\"\" class=\"wp-image-476\" srcset=\"https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/Maases-1024x88.png 1024w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/Maases-300x26.png 300w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/Maases-768x66.png 768w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/Maases-1536x132.png 1536w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/Maases.png 1625w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Plugin being used for Backup<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"120\" src=\"http:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/Maases-1-1024x120.png\" alt=\"\" class=\"wp-image-479\" srcset=\"https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/Maases-1-1024x120.png 1024w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/Maases-1-300x35.png 300w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/Maases-1-768x90.png 768w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/Maases-1-1536x180.png 1536w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/Maases-1.png 1638w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>2.)  Now we will configure AWS instance with lamp role configured on it. We will go with T2 medium type of instance .We will login and install httpd, php and Maria dB.<\/p>\n\n\n\n<p>To know more about installing the EC2 instance in AWS look into the following video. We will be configuring AWS Amazon Linux.<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"AWS basic and instance creation (Part 1)  (Hindi) - Cloud and Tech Tutorials\" width=\"631\" height=\"355\" src=\"https:\/\/www.youtube.com\/embed\/1F8TUtoocKI?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><figcaption><br><\/figcaption><\/figure>\n\n\n\n<p>To install httpd in linux use the following commands.<\/p>\n\n\n\n<div class=\"wp-container-4 wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<div class=\"wp-container-3 wp-block-group has-text-color\" style=\"color:#0806a2\"><div class=\"wp-block-group__inner-container\">\n<div class=\"wp-container-2 wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<div class=\"wp-container-1 wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<pre class=\"wp-block-preformatted\">yum update\nyum install httpd \nyum install httpd<\/pre>\n<\/div><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>Configure Mariadb repo.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">vi \/etc\/yum.repos.d\/MariaDB10.repo [mariadb]\nname = MariaDB\nbaseurl = http:\/\/yum.mariadb.org\/10.0\/centos7-amd64\ngpgkey=https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB\ngpgcheck=1 yum repolist all yum install MariaDB-server MariaDB-client yum repolist all\nyum install MariaDB-server MariaDB-client<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n<\/div><\/div>\n<\/div><\/div>\n<\/div><\/div>\n\n\n\n<p>Now we will do the secure installation of the database to remove anynomyms access and remote root login by using following command.<\/p>\n<!-- Quick Adsense WordPress Plugin: http:\/\/quickadsense.com\/ -->\n<div class=\"2c935cf620b701aabbb7cc90bbf4023c\" data-index=\"2\" style=\"float: none; margin:0px 0 0px 0; text-align:center;\">\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<script>\r\n  (adsbygoogle = window.adsbygoogle || []).push({\r\n    google_ad_client: \"ca-pub-5554449970657557\",\r\n    enable_page_level_ads: true\r\n  });\r\n<\/script>\n<\/div>\n\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql_secure_installation\n<\/pre>\n\n\n\n<p style=\"color:#050a9d\" class=\"has-text-color\"><\/p>\n\n\n\n<p>Now as we are using amazon linux we will installing php using amazon-linux-extras command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted style=\">amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2<\/pre>\n\n\n\n<p>3.) We have configured the Lamp role.&nbsp; Now we will install WordPress on the instance. First all of we will install the version of word press our website was using. My version was latest hence i ma downloading the latest version.<\/p>\n\n\n\n<div class=\"wp-container-5 wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<pre class=\"wp-block-preformatted\">wget https:\/\/wordpress.org\/latest.tar.gz \ntar -xvf latest.tar.gz<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>All content after untar will be in word press folder<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd wordpress\/<\/pre>\n<\/div><\/div>\n\n\n\n<p>4.) We will download the latest backup from the drop box shareable link. Then we will unzip in the WordPress folder.<\/p>\n\n\n\n<p>After we need to sync the word press folder under \/var\/www\/html<\/p>\n\n\n\n<div class=\"wp-container-6 wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<pre class=\"wp-block-preformatted\">rsync -avP ~\/wordpress\/ \/var\/www\/html\/<\/pre>\n<\/div><\/div>\n\n\n\n<p>5.) We need to restore the SQL backup file by importing it into Maria Db. Before doing it we need to create the new database my login into the mysql using below mentioned commands.<\/p>\n\n\n\n<div class=\"wp-container-7 wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<pre class=\"wp-block-preformatted\">sudo mysql -u root\ncreate database database-name;\ngrant all privileges on database-name.* to database-username@localhost identified by 'user-password';\nflush privileges;\nexit;\n\nOnce we have database created we need to import the bckyp *.sql in the downloaded zip using below command\n\nmysql -u wpuser -p wpdb &lt; i3349482_wp1.sql<\/pre>\n<\/div><\/div>\n\n\n\n<p>6.) In order to avoid conflicts with redirection we will be adding following lines into the wp-config.php files. Dont forgot to edit the new database, user and password name in wp-config.php<\/p>\n\n\n<pre class=\"&quot;wp-block-preformatted\">define('WP_SITEURL', 'http:\/\/newdomain');<br>define('WP_HOME', 'http:\/\/newdomain');<\/pre>\n\n\n<div class=\"wp-container-8 wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"1024\" src=\"http:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/My-Post-5-1024x1024.jpg\" alt=\"\" class=\"wp-image-502\" srcset=\"https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/My-Post-5-1024x1024.jpg 1024w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/My-Post-5-300x300.jpg 300w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/My-Post-5-150x150.jpg 150w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/My-Post-5-768x768.jpg 768w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/My-Post-5-1536x1536.jpg 1536w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/06\/My-Post-5-2048x2048.jpg 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>WordPress Restore<\/figcaption><\/figure>\n<\/div><\/div>\n\n\n\n<p>To see it performed practically step by step checkout the video below.<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"How to restore WordPress website  in AWS EC2 [Hindi] - Cloud and Tech Tutorials\" width=\"631\" height=\"355\" src=\"https:\/\/www.youtube.com\/embed\/qsxk7K7hB7g?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n\n<!-- Quick Adsense WordPress Plugin: http:\/\/quickadsense.com\/ -->\n<div class=\"2c935cf620b701aabbb7cc90bbf4023c\" data-index=\"3\" style=\"float: none; margin:0px 0 0px 0; text-align:center;\">\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<script>\r\n  (adsbygoogle = window.adsbygoogle || []).push({\r\n    google_ad_client: \"ca-pub-5554449970657557\",\r\n    enable_page_level_ads: true\r\n  });\r\n<\/script>\n<\/div>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">Today we will discuss about restoring word press website backup step by step. Existing Landscape: WordPress website is running on Go daddy. Steps to Restore: 1.) Mostly backup policy depends on rate of content change for the website. Generally speaking it is good practice to have one weekly full backup. In our case we will configure free backup plugin for&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"btn btn-default\" href=\"https:\/\/www.legendshub.com\/blog\/2020\/06\/13\/restoring-word-press-site-into-aws-ec2-instance-legendshub-blog\/\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":502,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[31],"tags":[135,134,132,133],"_links":{"self":[{"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/posts\/474"}],"collection":[{"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/comments?post=474"}],"version-history":[{"count":23,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/posts\/474\/revisions"}],"predecessor-version":[{"id":507,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/posts\/474\/revisions\/507"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/media\/502"}],"wp:attachment":[{"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/media?parent=474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/categories?post=474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/tags?post=474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}