<?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>BackUp &#8211; Hostry Help Center</title>
	<atom:link href="https://help.hostry.com/article-tags/backup/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>BackUp &#8211; Hostry Help Center</title>
	<link>https://help.hostry.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to back up MySQL databases</title>
		<link>https://help.hostry.com/knowledge-base/how-to-back-up-mysql-databases/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-back-up-mysql-databases/#comments</comments>
		
		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Mon, 10 Feb 2020 09:15:12 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=1395</guid>

					<description><![CDATA[MySQL is the software that is the most popular in the world that is used for databases. It is very important to make sure that you have backups. The causes of data loss can be very diverse: hardware failure, software changes, and much more. You can always restore your entire [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p><strong><em><a href="https://www.mysql.com/">MySQL</a></em></strong> is the software that is the most popular in the world that is used for databases. It is very important to make sure that you have <em><a href="https://hostry.com/blog/the-crucial-importance-of-backup/">backups</a></em>. The causes of data loss can be very diverse: hardware failure, software changes, and much more. You can always restore your entire database using backups.</p>



<p>The syntax for using the nysqldump command to export a database is. This shows us the following: </p>



<blockquote class="wp-block-quote"><p><strong>Access to the username database; </strong></p><p><strong>Mysqldump may ask you for a password; </strong></p><p><strong>Following are the processes that will tell us about backing up databases to an SQL file named name.sq</strong></p></blockquote>



<h2 id="restore-your-database" >Restore your database </h2>



<p><strong><em>Primarily!</em></strong> If something went wrong for you, you can easily restore your database. Log in to get started </p>



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



<p>Then create a new database</p>



<pre class="wp-block-code"><code>CREATE DATABASE newdb;</code></pre>



<p>Quit MySQL </p>



<pre class="wp-block-code"><code>exit</code></pre>



<p>After that, you can import the SQL file into a new database</p>



<pre class="wp-block-code"><code>mysql -u username -p newdb &lt; name.sql</code></pre>



<p>This completes the process of importing your <strong>SQL</strong> file into a new database!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-back-up-mysql-databases/feed/</wfw:commentRss>
			<slash:comments>11332</slash:comments>
		
		
			</item>
		<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>
		<item>
		<title>How To Make Backup And Restore PostgreSQL Databases on Ubuntu 18.04</title>
		<link>https://help.hostry.com/knowledge-base/how-to-make-backup-and-restore-postgresql-databases-on-ubuntu-18-04/</link>
		
		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Thu, 17 Oct 2019 06:22:13 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=799</guid>

					<description><![CDATA[PostgreSQL is a open source database management system that can be used to store information related to websites. This system exists in implementations for many UNIX-like platforms, including AIX, various BSD-systems, HP-UX, IRIX, Linux, macOS, Solaris / OpenSolaris, Tru64, QNX, as well as for Microsoft Windows. The most important task [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p><strong><em><a href="https://en.wikipedia.org/wiki/PostgreSQL">PostgreSQL</a></em></strong> is a open source database management system that can be used to store information related to websites. This system exists in implementations for many UNIX-like platforms, including AIX, various BSD-systems, HP-UX, IRIX, Linux, macOS, Solaris / OpenSolaris, Tru64, QNX, as well as for Microsoft Windows. </p>



<p>The most important task of the administrator is regular backup, it is an integral part of working with databases. The first thing to start is <strong>updating all system packages</strong></p>



<h2 id="updating-system-packages" >Updating System Packages</h2>



<p>Before starting, update the packages on your server</p>



<pre class="wp-block-code"><code>sudo apt-get update -y
sudo apt-get upgrade -y</code></pre>



<h2 id="postgresql-installation" >PostgreSQL installation</h2>



<p>PostgreSQL is available in the Ubuntu 18.04 repository and can be installed very simply with the following command:</p>



<pre class="wp-block-code"><code>sudo apt-get install postgresql postgresql-contrib</code></pre>



<p>Then you should start the <strong>postgresql</strong> service and <em>enable</em> it at boot time:</p>



<pre class="wp-block-code"><code>sudo systemctl start postgresql
sudo systemctl enable postgresql</code></pre>



<h2 id="backup-instructions" >Backup Instructions</h2>



<p>PostgreSQL comes with the <strong>pg_dump</strong> utility for calling information from the database to a file. You can run this utility from the command line interface. For example, if you want to back up one database, run the following command:</p>



<pre class="wp-block-code"><code>sudo pg_dump -U user_name database_name &gt; backup_file</code></pre>



<p><strong>IMPORTANT</strong>! The command must be run as root.</p>



<p>You can follow another way: backup the database by logging in as a postgres user:</p>



<pre class="wp-block-code"><code>sudo su - postgres
pg_dump postgres &gt; postgres.bak</code></pre>



<p>This command (which is indicated above, respectively) backs up the default database postgres.</p>



<p>Also, using the command below, it is possible to backup a remote database:</p>



<pre class="wp-block-code"><code>pg_dump -U user_name -h remote_ip_address -p remote_port database_name &gt; backup_file</code></pre>



<p>If you want to backup all the databases on your system, then <strong>pg_dumpall</strong> then you can use:</p>



<pre class="wp-block-code"><code>sudo pg_dumpall -U user_name &gt; backup_file</code></pre>



<h2 id="restore-instructions" >Restore Instructions</h2>



<p>Next, we will discuss how to restore the database created by the pg_dump command using the psql command, but first you need to create a empty base with<strong> name new_database</strong></p>



<pre class="wp-block-code"><code>sudo -u postgres psql
createdb -T template0 new_database</code></pre>



<p>Then you need to redirect the database dump caused by backup_files with the following command:</p>



<pre class="wp-block-code"><code>psql new_database &lt; backup_file</code></pre>



<p>It happens that errors are made during the backup process, and you urgently need to stop the recovery process when an error occurs, run the following command:</p>



<pre class="wp-block-code"><code>psql --set ON_ERROR_STOP=on new_database &lt; backup_file</code></pre>



<p>To restore the databases created by the pg_dumpall command, transfer the file to sql. You can use this command:</p>



<pre class="wp-block-code"><code>psql -U user_name -f backup_file   </code></pre>



<p>We recommend that you regularly store and <strong><a href="https://hostry.com/blog/the-crucial-importance-of-backup/">back up</a></strong>!</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
