<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Restore &#8211; Hostry Help Center</title>
	<atom:link href="https://help.hostry.com/article-tags/restore/feed/" rel="self" type="application/rss+xml" />
	<link>https://help.hostry.com</link>
	<description>Full information on how to use HOSTRY, provided by 24/7 community based support</description>
	<lastBuildDate>Thu, 21 Oct 2021 10:29:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.12</generator>

<image>
	<url>https://help.hostry.com/wp-content/uploads/cache/2021/01/cropped-apple-icon-180x180-1/836712163.png</url>
	<title>Restore &#8211; Hostry Help Center</title>
	<link>https://help.hostry.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How To Backup, Restore or Transfer MySQL/MariaDB Databases on Ubuntu</title>
		<link>https://help.hostry.com/knowledge-base/how-to-backup-restore-or-transfer-mysql-mariadb-databases-on-ubuntu/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-backup-restore-or-transfer-mysql-mariadb-databases-on-ubuntu/#comments</comments>
		
		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Fri, 18 Oct 2019 06:27:04 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=816</guid>

					<description><![CDATA[Today, Backup is a significant procedure and a very important part of working with databases. Regardless of whether you use a corporate website or just host WordPress, it is important to back up your databases. The backup storage is necessary in order to be able to restore information in a [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Today, <strong><em><a href="https://hostry.com/blog/the-crucial-importance-of-backup/">Backup</a></em></strong> is a significant procedure and a very important part of working with databases. Regardless of whether you use a corporate website or just host WordPress, it is important to back up your databases. The backup storage is necessary in order to be able to restore information in a very quick and convenient way, in the event that a working copy of the information may be lost for any reason: restoration of documents, settings, certain programs and other things.</p>



<h2 id="backup-process" >Backup process</h2>



<p>We recommend a way to back up a MySQL or MariaDB database using the <strong>mysqldump </strong>dump command. </p>



<pre class="wp-block-code"><code>echo "SHOW DATABASES;" | sudo mysql</code></pre>



<p>This command displays a list of your databases. Make sure you know which .sql file you need, and then simply run the following command to backup to the file.</p>



<pre class="wp-block-code"><code>sudo mysqldump example_database > $(date +"%F").sql</code></pre>



<p>The command described above will back up the example_database to a file with a date ending in .sql. It is also possible to change the name of this file to any other, although saving the file name as a date will be useful if you accidentally delete an important row or column. Use date &#8211;help to learn about other ways to style your date.</p>



<h2 id="recovery" >Recovery</h2>



<p>Here you need to find the .sql file that you created and run the following:</p>



<pre class="wp-block-code"><code>sudo mysql example_database &lt; filename.sql</code></pre>



<h2 id="migrating-to-mariadb-from-mysql" >Migrating to MariaDB from MySQL</h2>



<p>The first thing to do is back up each of your databases:</p>



<pre class="wp-block-code"><code>sudo mysqldump example_database > example_database.sql</code></pre>



<p>After that, you will need to install MariaDB, which will replace MySQL, and restore your databases by following these steps for each database.</p>



<pre class="wp-block-code"><code>sudo mysql example_database &lt; example_database.sql</code></pre>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-backup-restore-or-transfer-mysql-mariadb-databases-on-ubuntu/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How To Make a  Backup and Restore MySQL on Ubuntu 20.04</title>
		<link>https://help.hostry.com/knowledge-base/how-to-make-a-backup-and-restore-mysql-on-ubuntu-20-04/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-make-a-backup-and-restore-mysql-on-ubuntu-20-04/#comments</comments>
		
		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Thu, 21 Oct 2021 10:29:07 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=4377</guid>

					<description><![CDATA[When working with databases, you have to make backups. This tutorial will focus on MySQL on Ubuntu 20.04. The process will be described in detailed commands and also to secure your data. Copying your data from the Ubuntu server First, you need to be logged in as a user with [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>When working with databases, you have to make backups. This tutorial will focus on MySQL on Ubuntu 20.04. The process will be described in detailed commands and also to secure your data.</p>



<h2 id="copying-your-data-from-the-ubuntu-server" >Copying your data from the Ubuntu server</h2>



<p>First, you need to be logged in as a user with root privileges. After successful login, you need to check the list of databases. This can be done by entering a simple command:</p>



<pre class="wp-block-code"><code>mysql -u USERNAME</code></pre>



<p>Further, after a successful login, you need to enter a special command that will provide you with the entire list of databases. This command looks like this:</p>



<pre class="wp-block-code"><code>SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| test_data          |
| important_db       |
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
5 rows in set (0.012 sec)</code></pre>



<p>Then you can close the command line by typing <strong><em>exit;</em></strong></p>



<h2 id="using-mysqldump" >Using Mysqldump</h2>



<p>You may need to use a password for login. To do this, just add<strong> -p</strong> to the command below. If you need to keep all databases, you can use the shortcut <strong>&#8211;all-databases</strong> instead of<strong> &#8211;databases names</strong></p>



<pre class="wp-block-code"><code>mysqldump -u USERNAME --databases test_data important_db &gt; database_dump.sql</code></pre>



<p>Then the file is <em>automatically </em>generated. It will be named <strong>&#8220;database_dump.sql&#8221;</strong>. Its content includes all data for restoring the databases that you specify.</p>



<h2 id="protecting-your-backup-process" >Protecting Your Backup Process</h2>



<p>An important recommendation: if the data in the database contains sensitive data, then you should definitely encrypt it before you save or start the process of moving between servers. Run the first command below and then enter your password; it will not appear on your screen.</p>



<pre class="wp-block-code"><code>openssl enc -aes-256-cbc -pbkdf2 -in database_dump.sql -out database_dump.sql.enc
  enter aes-256-cbc encryption password:
  Verifying - enter aes-256-cbc encryption password:


rm database_dump.sql</code></pre>



<p>In order for you to be able to decrypt your backup, you can use a special command, which is indicated below:</p>



<pre class="wp-block-code"><code>openssl enc -d -aes-256-cbc -pbkdf2 -in database_dump.sql.enc -out database_dump.sql
  enter aes-256-cbc encryption password:</code></pre>



<h2 id="the-process-of-moving-a-backup" >The process of moving a backup</h2>



<p>During the backup process, the .sql size can be bulky in size. This will negatively affect the file and data transfer process. Instead, you can use tools such as rsync to exchange data directly between servers.</p>



<pre class="wp-block-code"><code>rsync -a ./database_dump.sql user@185.186.244.123:/tmp/</code></pre>



<blockquote class="wp-block-quote"><p><strong>185.186.244.123</strong> &#8211; should be changed to your server address<br><strong>user</strong> is the username on the remote server<br><strong> tmp/</strong> &#8211; should be replaced with your remote server directory</p></blockquote>



<p>To restore your database, you can use the special <strong>mysql</strong> utility, an example is shown below:</p>



<pre class="wp-block-code"><code>mysql -u USERNAME &lt;database_dump.sql</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-make-a-backup-and-restore-mysql-on-ubuntu-20-04/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
