{"id":189,"date":"2013-10-05T18:14:10","date_gmt":"2013-10-05T18:14:10","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=189"},"modified":"2017-09-09T16:20:43","modified_gmt":"2017-09-09T16:20:43","slug":"how-to-backup-a-wordpress-site-from-the-command-line","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/how-to-backup-a-wordpress-site-from-the-command-line\/","title":{"rendered":"How to Backup a WordPress Site from the Command Line"},"content":{"rendered":"<p>There are 2 things we need to do when we backup a WordPress site.<\/p>\n<ol>\n<li>Backup the WordPress files<\/li>\n<li>Backup The WordPress database<\/li>\n<\/ol>\n<p><strong> Backup the WordPress files<br \/>\n<\/strong><\/p>\n<p>We can backup the files with tar by running the following command.\u00a0 Replace (\/Path\/to\/wpdir) with the actual path.<\/p>\n<pre>#  tar -zcvf wp-backup.tgz \/Path\/to\/wpdir\/<\/pre>\n<p>This can take awhile depending on how big your site is.<\/p>\n<p><strong>Backup the Database <\/strong><\/p>\n<p>The following command will backup the WordPress database into a gziped sql file.<\/p>\n<pre>mysqldump -u username -p[root_password] database_name &gt; wp-database.sql &amp;&amp; gzip wp-database.sql<\/pre>\n<p>You can find the MySQL Database, username, and password in the wp-config.php file in the wordpress directory<\/p>\n<p>You should now have two files, wp-backup.tgz and wp-database.sql.qz, you&#8217;ll need both of these to restore the backup.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are 2 things we need to do when we backup a WordPress site. Backup the WordPress files Backup The WordPress database Backup the WordPress files We can backup the files with tar by running the following command.\u00a0 Replace (\/Path\/to\/wpdir) &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/how-to-backup-a-wordpress-site-from-the-command-line\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44,72],"tags":[75,74,73],"class_list":["post-189","post","type-post","status-publish","format-standard","hentry","category-web","category-wordpress","tag-backup","tag-wordpress-2","tag-wordpress-backup"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=189"}],"version-history":[{"count":13,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/189\/revisions"}],"predecessor-version":[{"id":1637,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/189\/revisions\/1637"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}