<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ Backup - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ Backup - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Tue, 26 May 2026 16:23:45 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/backup/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Back Up and Restore Azure SQL Databases ]]>
                </title>
                <description>
                    <![CDATA[ Microsoft's Azure provides many services via a single cloud, which lets them offer one solution for multiple corporate infrastructures. Development teams often use Azure because they value the opportunity to run SQL databases in the cloud and complet... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-back-up-and-restore-sql-azure-database/</link>
                <guid isPermaLink="false">66ba2f06d8f1b6513f67389b</guid>
                
                    <category>
                        <![CDATA[ Azure ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Backup ]]>
                    </category>
                
                    <category>
                        <![CDATA[ database ]]>
                    </category>
                
                    <category>
                        <![CDATA[ SQL ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Alex Tray ]]>
                </dc:creator>
                <pubDate>Wed, 24 Jan 2024 22:34:09 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/12/maxresdefault.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Microsoft's Azure provides many services via a single cloud, which lets them offer one solution for multiple corporate infrastructures. Development teams often use Azure because they value the opportunity to run SQL databases in the cloud and complete simple operations via the Azure portal. </p>
<p>But you'll need to have a way to back up your data, as it's crucial to ensuring the functionality of the production site and the stability of everyday workflows. So creating Azure SQL backups can help you and your team avoid data loss emergencies and have the shortest possible downtime while maintaining control over the <a target="_blank" href="https://www.hostpapa.com/blog/technology/what-is-an-it-infrastructure/">infrastructure</a>.</p>
<p>Another reason to have a current Azure database backup is Microsoft’s policy. Microsoft uses the shared responsibility model, which makes the user responsible for data integrity and recovery while Microsoft only ensures the availability of its services. Microsoft directly recommends using third-party solutions to create database backups. </p>
<p>In case you run a local SQL Server, you'll need to prepare for the possibility of hardware failures that may result in data loss and downtime. An SQL database on Azure helps mitigate that risk, although it's still prone to human errors or cloud-specific threats like malware. </p>
<p>These and other threats make enabling Azure SQL database backups necessary for any organization using Microsoft’s service to manage and process data. </p>
<p>In this tutorial, you'll learn about backing up Azure databases and restoring your data on demand with native instruments provided by Microsoft, including methods like: </p>
<ul>
<li>Built-in Azure database backup functionality</li>
<li>Cloud archiving</li>
<li>Secondary database and table management</li>
<li>Linked server</li>
<li>Stretch Database</li>
</ul>
<h2 id="heading-why-backup-your-sql-azure-database">Why Backup Your SQL Azure Database?</h2>
<p>Although I covered this briefly in the intro, there are many reasons to back up your SQL Azure database data. </p>
<h3 id="heading-disaster-recovery">Disaster Recovery</h3>
<p>Data centers can be damaged or destroyed by planned cyberattacks, random malware infiltration (<a target="_blank" href="https://www.nakivo.com/blog/how-to-protect-against-ransomware-attacks/">check out this article</a> to discover more on ransomware protection), and natural disasters like floods or hurricanes, among others. Backups can be used to swiftly recover data and restore operations after various disaster cases.</p>
<h3 id="heading-data-loss-prevention">Data Loss Prevention</h3>
<p>Data corruption, hardware failure, and accidental or malicious deletion lead to data loss and can threaten an organization. Backup workflows set up to run regularly mean you can quickly recover the data that was lost or corrupted.</p>
<h3 id="heading-compliance-and-regulations">Compliance and Regulations</h3>
<p>Compliance requirements and legislative regulations can be severe regardless of your organization’s industry. Mostly, laws require you to keep up with security and perform regular backups for compliance.</p>
<h3 id="heading-testing-and-development">Testing and Development</h3>
<p>You can use backups to create Azure database copies for development, troubleshooting, or testing. Thus, you can fix, develop, or improve your organization’s workflows without involving the production environment.</p>
<h2 id="heading-how-to-back-up-your-azure-sql-database">How to Back Up Your Azure SQL Database</h2>
<p>Backing up your Azure SQL database can be challenging if you go through the process without preparation. So that's why I wrote this guide – to help you be prepared. Here's what we'll cover in the following sections:</p>
<ul>
<li>Requirements for SQL Azure database backup</li>
<li>How to configure database backups in Azure with native tools</li>
<li>Cloud archiving</li>
<li>Backup verification and data restoration</li>
</ul>
<h3 id="heading-sql-azure-database-backup-requirements">SQL Azure Database Backup Requirements</h3>
<p>Before backing up your SQL Azure databases, you need to create and configure Azure storage. Before you do that, you'll need to go through the following steps:</p>
<p>First, open the Azure management portal and find <strong>Create a Resource</strong>.</p>
<p>Then, go to <strong>Storage</strong> &gt; <strong>Storage account</strong>. Provide the information, including the location and names of a storage account and resource group according to your preferences. After you enter the information, hit <strong>Next</strong>.</p>
<p><img src="https://lh7-us.googleusercontent.com/TbuVyIRHXKkKd1__mMSo8RJTktZVnJjK2r8ijtY1h5gvlY5KqkRE8NPsej18m-A1-p3UwF-YO0W0p9AzJa8AW7TwR1yXp531y7qXrm84hJQIuTIKUMwhbnU7WAiUoGRPIdL_SrQCv0nxav4RnCu389o" alt="Image" width="800" height="500" loading="lazy">
<em>Storage account config</em></p>
<p>Then go to the advanced section for additional settings. The optimal choice is to set _"_Secure transfer required" as <strong>Enabled</strong> and "Allow access" from <strong>All</strong> networks. For more resilience in case of human error, you can set "Blob soft delete" as <strong>Enabled</strong>. With that setting, you can quickly correct accidental deletions in the storage account.</p>
<p>After that, specify the tags you need to simplify navigating through your infrastructure.</p>
<p><img src="https://lh7-us.googleusercontent.com/BTXJpa8dz9wKa7p9pQm84fmtqtwD5WEuRB9yh2_Htpa-pF86Zf70CuKP7j32uPR56igplljn6fehCuJEgnMkiCiAcZPZVU_FNEL2JZcrtVjunthzLKQOWp9wbtXLLLKMgYTerYNJpsiQxZjJcMlr05I" alt="Image" width="1000" height="563" loading="lazy">
<em>Azure backup storage tags</em></p>
<p>Check the settings once more. If everything is configured correctly, hit <strong>Create</strong>. Your new storage account is now created.</p>
<p>Once the storage volume is created, it's time to configure a backup data storage container. </p>
<p>Go to the storage account, find <strong>Containers</strong>, then hit the <strong>+ Container</strong> tab there. After that, specify a name for the new container and switch Public access level to <strong>Private (no anonymous access)</strong>.</p>
<p><img src="https://lh7-us.googleusercontent.com/eGTyBc9-uiRO52QsQ0pGzlWPAZlvyMR0miExCMX-Pck9yPQvUlwKqa0_N-zWc908TzHONdzLC2Kv8ACU5UHJjuJ8G6kBOmgxONkLN5LE33ItBsKOx5XdIKtMg8oYDY6eKrdFrZ0bhuOD535QALtqxMU" alt="Image" width="1600" height="955" loading="lazy">
<em>Container Azure storage account</em></p>
<p>You can then use the container as a backup storage (.bak files will be stored there in that case).</p>
<h2 id="heading-azure-database-backup-configuration">Azure Database Backup Configuration</h2>
<p>Now, everything is set up for you to back up your SQL Azure database. Do the following to create a database backup:</p>
<p>First, go to <strong>SQL Management Studio</strong>, and establish a connection with the SQL server. After that, right-click the database that should be backed up. The context menu appears, so go to <strong>Tasks</strong> there. Then hit <strong>Back Up…</strong>. </p>
<p><img src="https://lh7-us.googleusercontent.com/l5g6ajoZ6ZuBObluCiG7mra9pz9BPgP-iOCAoGh36SY5zfg1yv300oQQ1cvgrVFNL75Nu7roFIVp2BfPze3ag5nTzL1NQYiO_fhUokWSd9fVms1SDcoP5pJ7a4wWdB3fQJWeKbrNIK_-vo2-hiXTDl0" alt="Image" width="1348" height="720" loading="lazy">
<em>SQL server tasks backup</em></p>
<p>Then find the Destination tab, and set <strong>Back up to line to URL</strong> there. After that, hit <strong>New container</strong>.</p>
<p>Next, sign in to Azure. Pick the container you created before. Provide your credentials, then hit <strong>OK</strong>.</p>
<p>You’ll see a message asking you to sign in to Azure subscription. Then, choose the container and hit <strong>OK</strong>.</p>
<p>Now, you'll see the configured backup destination URL listed. To start the workflow to back up your Azure data, hit <strong>OK</strong> once again.</p>
<p>When your SQL Azure database backup is completed, the message shows up: "<em>The backup of database ‘your database name’ completed successfully</em>."</p>
<p>The backup file in the target container should now be visible from the Azure portal.</p>
<p>Keep in mind that, when uploading backups to any cloud storage, you may face issues if your network connection is not fast enough. </p>
<p>In case that’s true for you, you can reorganize your backup workflows: send backup data to a physical storage drive first, and then send another copy to the cloud. Thus, you can prevent operational challenges that might appear due to network bandwidth deficiency.</p>
<h2 id="heading-cloud-archiving-for-azure-database-backups">Cloud Archiving for Azure Database Backups</h2>
<p>Databases tend to grow in volume as the organization grows. This means that the storage space required to fit the data and that data's backup increases significantly. Also, the original data volume prolongs the duration of full backup workflows, posing another challenge. </p>
<p>Of course, the first way to get more storage space is to revise your data regularly and erase records that are irrelevant, outdated, or unnecessary otherwise. Still, it's sometimes difficult to determine if data will be or become unnecessary or irrelevant, especially when dealing with issues of compliance. </p>
<p>To keep your organization compliant in any case, data archiving can help you solve two problems at once: you can ensure data accessibility on one hand, and save storage space on the other hand.</p>
<p>To archive your SQL database in the cloud, you should first save that database copy to an Azure blob container. Then, to move a newly created blob to the archive tier in the Azure portal, do the following: </p>
<ol>
<li>Go to the required container where the SQL database is stored.</li>
<li>Choose the blob that you need to move.</li>
<li>Hit <strong>Change tier</strong>.</li>
</ol>
<p><img src="https://lh7-us.googleusercontent.com/p41GC9ys42mQBQGWW1jqcR2xCfACpCYF1MpGG7Qx6EdqzjDSK6xnuqlPRCtDuhEmH_-8E6Lz2gY8H3h1CoZ4_jpScQWUxB-21GXOnuDEBSHVJiGa1zBiHu4JJP2Xntq1fpbPLjbb1-APOTJMO2sdBMk" alt="Image" width="1281" height="629" loading="lazy">
<em>Azure blob container change tier</em></p>
<ol start="4">
<li>In the <strong>Access tier</strong> dropdown menu, choose <strong>Archive</strong>.</li>
</ol>
<p><img src="https://lh7-us.googleusercontent.com/qlyKGop3uj6kfi71fSpVsqKkhf8vc1TiQRyoeHEiwjKdg1i3Dsz_LXLHcD5q-qR77utIPUbkLyWU7Xzn7ehl3Z1IWUQZjy0LndXLEcDA1PRZj4ufO8QGR0GCmEDGqoWQ6paFwo8pn0VbUH8RWjlRzLU" alt="Image" width="432" height="283" loading="lazy">
<em>Azure blob change tier</em></p>
<ol start="5">
<li>Hit <strong>Save</strong>.</li>
</ol>
<p>Additionally, the Archive storage tier is the most affordable one in Azure, meaning that you can reduce your database data TCO with it.</p>
<h3 id="heading-secondary-database-and-table-management">Secondary Database and Table Management</h3>
<p>There exist several workflows that can help you set up Azure database backup archiving for your organization. When you need the data to stay in the initial database, for instance, creating a separate table and moving that data there can be your choice. However, the filegroup of that table should stay apart from the main database and be moved to a separate disk whenever possible. </p>
<p>Most probably, you’ll want to let users access the data you send to a separate table. To make that happen, you can create a view merging the relevant tables and redirect the requests to that view, not to the original table. Doing things that way, you can keep the data accessible while dealing with maintenance faster.</p>
<h3 id="heading-sql-server-linking">SQL Server Linking</h3>
<p>If you can’t move the data to another database for internal reasons such as special Azure backup policies, you can consider maintaining your primary database accordingly. </p>
<p>Here, the outcome is likely to be that of the previous case, but you need to link the SQL servers or configure apps so they can send direct requests to your second server. </p>
<p>The downside here is that your SQL database, which was supposed to be a backup one, becomes a production database and gains appropriate importance for an organization.</p>
<p>There are two ways to create linked servers via SQL Server Management Studio (SSMS): </p>
<ul>
<li><strong>sp_addlinkedserver</strong> (Transact-SQL) system stored procedure that creates a linked server</li>
<li><strong>SSMS GUI</strong></li>
</ul>
<p>After you've ensured that you have appropriate access rights on both server instances you need to link, the network is configured appropriately to access them, and SSMS is installed, you'll need to go through the following steps:</p>
<p>First, open SSMS.</p>
<p><img src="https://lh7-us.googleusercontent.com/6NS8wE2UmtV5Bs3-loE7kIASfehk4-hSaPP5y7Wm1oEVIUFDCPyxD_f1rLQzxsJVdCGaFJwcRHqKVrnypgETOSohLP5hQK50m4tj4pBZBIx6oTUj8WOJbcttfhy0IybUyC_CrJCyK8saEPnchKInp7g" alt="Image" width="1499" height="1087" loading="lazy">
<em>Microsoft SSMS</em></p>
<p>Connect to the instance where you need to establish a linked server. Then find <strong>Object Explorer &gt; Server Objects</strong>, then right-click <strong>Linked Servers</strong>.</p>
<p>Pick <strong>New Linked Server</strong> from the dropdown:</p>
<p><img src="https://lh7-us.googleusercontent.com/tD5YO2e1RtfLUmtBdRFNfiHQSyaxnQml9lBGnRPPzuNrW4Fcu-3alTg4N3-mdR-oQxcaUyMpyqp36l7r3aTfg29RzT6Jgx0Nb1eT2T-y-zotl1RujRUIC4gSwE25aslpfMJJUvNW4MMivP4BstyQu4o" alt="Image" width="400" height="340" loading="lazy">
<em>New linked server SSMS</em></p>
<p>Then configure the server properties, including name, server type, provider and product name:</p>
<p><img src="https://lh7-us.googleusercontent.com/y-WSzJni8uyKBAcJywPqk-iufIeJ_4TTs1rf3e_9RYhj1Kt8nUsZfad9Vekec4yL6eFCX8doLR4Qr7iA6X3p78jnRfIs3AYlHMn1GOhR8Ya29CW5X9DIU-nbj_jDaTwAvwEJXNjr7npd5THmnD7Iv3A" alt="Image" width="400" height="378" loading="lazy">
<em>Linked server configuration SSMS</em></p>
<p>Then you'll just need to complete the security configuration, set up the server options, and complete connection testing.</p>
<h3 id="heading-original-data-deletion">Original Data Deletion</h3>
<p>When you don’t need 24/7 data availability but need the data stored due to internal policies or compliance requirements, you can choose what's probably the simplest solution to increase storage space efficiency. Just back up the data that can stay unavailable and then delete the originals from the main database. Accessing any records you may need will still be possible via the backup.</p>
<h3 id="heading-stretch-database">Stretch Database</h3>
<p>Aiming to make data management of organizations’ databases simpler, Microsoft implemented a Stretch Database feature in SQL Server 2016. With this feature, you can get an SQL backup to Azure after you send the data from the hosted database to an Azure SQL database. The method enables you to increase overall infrastructure cost-efficiency by simplifying backup workflows.</p>
<p>To enable this workflow in your environment, develop the policy specifying the data on a hosted server to send to Azure. You don’t need to introduce any changes in applications that use the production database: SQL Server can independently get the records from the Azure SQL Database.</p>
<h3 id="heading-azure-database-backups-verification-and-restoration">Azure Database Backups Verification and Restoration</h3>
<p>During an SQL Azure database backup, you can choose to create such backups <strong>WITH CHECKSUMS</strong> or without them. When the workflow is complete, I recommend you use the following command: <strong><code>RESTORE VERIFYONLY</code></strong>. This command enables you to check the recoverability of backup files.  </p>
<p>To access the data, you can restore records from a backup to a different database. With Azure Automation scripts on backups, you can accelerate the restoration process, thus minimizing downtime and increasing the overall resilience of your Azure infrastructure. </p>
<p>You need to follow only a few steps to restore an Azure SQL database to a required recovery point from a backup. Still, keep in mind that your subscription can define the available retention period which can vary from 7 to 35 days. A native tool for backup restoration to SQL servers is Server Management Studio.</p>
<h2 id="heading-to-conclude">To Conclude</h2>
<p>The critical nature of Azure SQL database data makes Azure SQL backups obligatory for any organization that uses this Microsoft solution. In this guide, we reviewed the process of creating SQL Azure database backup using native Microsoft tools. </p>
<p>These tools provide data backup, backup verification, and recovery functionality along with some automation. </p>
<p>You can also implement a specialized all-in-one data protection solution, such as <a target="_blank" href="https://www.nakivo.com/backup-to-azure-blob/">NAKIVO</a>, the company where I work. It can help you make your data backup workflows more efficient.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Automate SQL Database Backups Using Python ]]>
                </title>
                <description>
                    <![CDATA[ You should back up your SQL database on a regular basis. It's a critical task that helps ensure that your data is always protected. But manually backing up a database can be time-consuming and error-prone, especially if you have multiple databases to... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/automate-sql-database-backups-using-python/</link>
                <guid isPermaLink="false">66d4608db6b7f664236cbe2b</guid>
                
                    <category>
                        <![CDATA[ Backup ]]>
                    </category>
                
                    <category>
                        <![CDATA[ database ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                    <category>
                        <![CDATA[ SQL ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Jeremiah Oluseye ]]>
                </dc:creator>
                <pubDate>Thu, 16 Mar 2023 14:49:50 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/03/rere.JPG" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>You should back up your SQL database on a regular basis. It's a critical task that helps ensure that your data is always protected.</p>
<p>But manually backing up a database can be time-consuming and error-prone, especially if you have multiple databases to back up.</p>
<p>In this article, we will explore how to automate SQL database backups using Python, making the process faster, easier, and less error-prone.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>Before we get started, you will need to have the following installed:</p>
<ul>
<li><p>Python 3.x</p>
</li>
<li><p>pip</p>
</li>
<li><p>The <code>pyodbc</code> package (for connecting to SQL databases)</p>
</li>
<li><p>The <code>pandas</code> package (for working with data)</p>
</li>
<li><p>A SQL database to back up</p>
</li>
</ul>
<h2 id="heading-step-1-how-to-connect-to-the-sql-database">Step 1: How to Connect to the SQL Database</h2>
<p>The first step in automating SQL database backups is to connect to the database using Python. We will use the <code>pyodbc</code> package to connect to the database and execute SQL commands.</p>
<p>Here is an example code snippet that connects to a SQL Server database:</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> pyodbc

<span class="hljs-comment"># Connection parameters</span>
server = <span class="hljs-string">'localhost'</span>
database = <span class="hljs-string">'mydatabase'</span>
username = <span class="hljs-string">'myusername'</span>
password = <span class="hljs-string">'mypassword'</span>

<span class="hljs-comment"># Create a connection object</span>
conn = pyodbc.connect(<span class="hljs-string">'DRIVER={SQL Server};SERVER='</span> + server + <span class="hljs-string">';DATABASE='</span> + database + <span class="hljs-string">';UID='</span> + username + <span class="hljs-string">';PWD='</span> + password)

<span class="hljs-comment"># Create a cursor object</span>
cursor = conn.cursor()
</code></pre>
<p>In this code, we create a connection object using the <code>pyodbc.connect()</code> method and pass in the connection parameters. We then create a cursor object using the <code>conn.cursor()</code> method, which allows us to execute SQL commands on the database.</p>
<h2 id="heading-step-2-how-to-create-a-backup">Step 2: How to Create a Backup</h2>
<p>Once we have connected to the database, we can create a backup using the <code>BACKUP DATABASE</code> SQL command.</p>
<p>Here is an example code snippet that creates a full backup of a SQL Server database:</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> os

<span class="hljs-comment"># Backup directory</span>
backup_dir = <span class="hljs-string">'C:/backup'</span>

<span class="hljs-comment"># Backup file name</span>
backup_file = <span class="hljs-string">'mydatabase_backup_'</span> + str(datetime.now().strftime(<span class="hljs-string">'%Y%m%d_%H%M%S'</span>)) + <span class="hljs-string">'.bak'</span>

<span class="hljs-comment"># Backup command</span>
backup_command = <span class="hljs-string">'BACKUP DATABASE mydatabase TO DISK=\''</span> + os.path.join(backup_dir, backup_file) + <span class="hljs-string">'\''</span>

<span class="hljs-comment"># Execute the backup command</span>
cursor.execute(backup_command)
</code></pre>
<p>In this code, we specify the backup directory and file name and use the <code>os.path.join()</code> method to create a full file path. We then create the backup command using the <code>BACKUP DATABASE</code> SQL command and execute it using the cursor object.</p>
<h2 id="heading-step-3-how-to-save-backup-details">Step 3: How to Save Backup Details</h2>
<p>After creating a backup, it's a good idea to save some information about the backup, such as the backup file name, backup date and time, and the database name. We can save this information to a CSV file using the <code>pandas</code> package.</p>
<p>Here is an example code snippet that saves backup details to a CSV file:</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd

<span class="hljs-comment"># Backup details</span>
backup_details = {<span class="hljs-string">'database'</span>: [database], <span class="hljs-string">'backup_file'</span>: [backup_file], <span class="hljs-string">'backup_datetime'</span>: [datetime.now()]}

<span class="hljs-comment"># Create a DataFrame object from the backup details</span>
backup_df = pd.DataFrame(data=backup_details)

<span class="hljs-comment"># Backup details file</span>
backup_details_file = os.path.join(backup_dir, <span class="hljs-string">'backup_details.csv'</span>)

<span class="hljs-comment"># Write backup details to a CSV file</span>
backup_df.to_csv(backup_details_file, index=<span class="hljs-literal">False</span>)
</code></pre>
<p>In this code, we create a dictionary object containing the backup details and create a DataFrame object from it using the <code>pd.DataFrame()</code> method.</p>
<p>We then specify the backup details file using the <code>os.path.join()</code> method and write the backup details to a CSV file using the <code>to_csv()</code> method.</p>
<h2 id="heading-step-4-how-to-automate-the-backup-process">Step 4: How to Automate the Backup Process</h2>
<p>Now that we have created a backup and saved backup details, we can automate the backup process using a Python script. We can schedule the script to run at regular intervals using the built-in Windows Task Scheduler or a third-party scheduling tool like CronTab (for Linux) or Task Scheduler (for Mac).</p>
<p>Here is an example Python script that automates SQL database backups:</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> pyodbc
<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd
<span class="hljs-keyword">from</span> datetime <span class="hljs-keyword">import</span> datetime

<span class="hljs-comment"># Connection parameters</span>
server = <span class="hljs-string">'localhost'</span>
database = <span class="hljs-string">'mydatabase'</span>
username = <span class="hljs-string">'myusername'</span>
password = <span class="hljs-string">'mypassword'</span>

<span class="hljs-comment"># Backup directory</span>
backup_dir = <span class="hljs-string">'C:/backup'</span>

<span class="hljs-comment"># Create a connection object</span>
conn = pyodbc.connect(<span class="hljs-string">'DRIVER={SQL Server};SERVER='</span> + server + <span class="hljs-string">';DATABASE='</span> + database + <span class="hljs-string">';UID='</span> + username + <span class="hljs-string">';PWD='</span> + password)

<span class="hljs-comment"># Create a cursor object</span>
cursor = conn.cursor()

<span class="hljs-comment"># Backup file name</span>
backup_file = <span class="hljs-string">'mydatabase_backup_'</span> + str(datetime.now().strftime(<span class="hljs-string">'%Y%m%d_%H%M%S'</span>)) + <span class="hljs-string">'.bak'</span>

<span class="hljs-comment"># Backup command</span>
backup_command = <span class="hljs-string">'BACKUP DATABASE mydatabase TO DISK=\''</span> + os.path.join(backup_dir, backup_file) + <span class="hljs-string">'\''</span>

<span class="hljs-comment"># Execute the backup command</span>
cursor.execute(backup_command)

<span class="hljs-comment"># Backup details</span>
backup_details = {<span class="hljs-string">'database'</span>: [database], <span class="hljs-string">'backup_file'</span>: [backup_file], <span class="hljs-string">'backup_datetime'</span>: [datetime.now()]}

<span class="hljs-comment"># Create a DataFrame object from the backup details</span>
backup_df = pd.DataFrame(data=backup_details)

<span class="hljs-comment"># Backup details file</span>
backup_details_file = os.path.join(backup_dir, <span class="hljs-string">'backup_details.csv'</span>)

<span class="hljs-comment"># Write backup details to a CSV file</span>
backup_df.to_csv(backup_details_file, index=<span class="hljs-literal">False</span>)
</code></pre>
<p>In this script, we have combined the previous code snippets into one script, making it easy to automate the backup process.</p>
<p>We first connect to the database, create a backup, save backup details to a CSV file, and then disconnect from the database.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Automating SQL database backups using Python is a great way to save time, reduce the risk of errors, and ensure that data is always protected.</p>
<p>By following the steps outlined in this article, you can easily automate SQL database backups and schedule them to run at regular intervals.</p>
<p>Remember to test your backups regularly to ensure that they are working correctly and that you can restore data when needed.</p>
<p>Let’s connect on <a target="_blank" href="https://twitter.com/Olujerry19">Twitter</a> and <a target="_blank" href="https://www.linkedin.com/in/jeremiah-oluseye-58457719a/">Linkedin</a></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Backup Your Hashnode Articles to GitHub ]]>
                </title>
                <description>
                    <![CDATA[ Many developers have a personal blog on Hashnode, one of the most popular blogging communities for people exploring tech.  I also write on Hashnode, but recently I was thinking about whether there is any way to backup my published articles to GitHub.... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-backup-hashnode-articles-to-github/</link>
                <guid isPermaLink="false">66b902c15730a049b6bfea78</guid>
                
                    <category>
                        <![CDATA[ Backup ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Blogging ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Mon, 16 May 2022 15:21:57 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/05/gradient-color-Modern-Music-Playlist-YouTube-Thumbnail.gif" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Many developers have a personal blog on <a target="_blank" href="https://hashnode.com/">Hashnode</a>, one of the most popular blogging communities for people exploring tech. </p>
<p>I also write on Hashnode, but recently I was thinking about whether there is any way to backup my published articles to GitHub. Fortunately, I have found an easy way to do that directly from Hashnode itself.</p>
<p>So, in this article, I will share the process so that you can also create an automatic backup of your articles to your GitHub repository. There's no harm in trying something new, right? 😊</p>
<p>✨ I have also created a full length video showing the process of creating that automatic backup to your GitHub repo. I have attached the video later in this article. You can also check that out.</p>
<p>Firstly, let me show you my Hashnode account. This is just a sample of a typical profile there.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_00_31_58.Still002.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>I have published only one article (as of today, 15 May 2022). But I still want to create an automatic backup process for this account so that whenever I write something new, all of the articles get copied into my selected GitHub repository as a backup.</p>
<p>So let's do that, shall we? 😁</p>
<h3 id="heading-how-to-backup-your-hashnode-articles-to-github">How to Backup Your Hashnode Articles to GitHub</h3>
<p>Go to your GitHub account. We need to create a special repository first where we will create an automatic backup process.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/Screenshot-2022-05-15-093838.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Now simply click on the <code>+</code> button on the top right of the webpage.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_01_54_29.Still004.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Now click <strong>New repository</strong>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_02_00_23.Still005-1.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Now we have to create a new repository. The process is similar to creating any other repository.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_02_03_28.Still006.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You can make the repository Public or Private as you see fit for yourself. I am making it a Private repository, but you do not have to do that if you don't want to.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_02_41_42.Still008.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Give the repository any name you want.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_02_57_02.Still009.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>For the latter, you can select anything you want. For this article, I am keeping it simple as it was.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_03_18_19.Still010.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Then click <strong>Create repository</strong>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_03_37_16.Still011.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>After that, you actually do not need to do anything in that repository for now.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_03_41_19.Still012.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>So, I am keeping it as it is right now.</p>
<p>Now, head over to your Hashnode account. </p>
<p>Click your profile icon on the top right of the profile page.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_03_46_36.Still013.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Select the blog you want to backup. For me, it is <a target="_blank" href="https://fahimbinamin.hashnode.dev/">https://fahimbinamin.hashnode.dev/</a>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_03_47_50.Still014.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Click Blog Dashboard.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_03_53_36.Still015.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>The blog dashboard will appear before you.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_03_58_22.Still016.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Simply scroll down until you find Backup. You will find that on the lower left side of the webpage. Click on that.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_04_12_46.Still017.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You will find the GitHub Backup page now. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_05_03_47.Still020.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Click on Back up all my posts.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_05_03_47.Still020-1.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Select where you want to install it.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_05_06_45.Still021.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>As I am involved in 5 GitHub organizations right now, it's suggesting all of them to me. As I want to create the backup on my personal GitHub account, I will select my profile <strong>FahimFBA</strong>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_05_33_05.Still022.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>The install and authorize section will appear.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_05_44_25.Still023.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>By default, it will select "All repositories". <strong>But keep in mind, that you shouldn't select All repositories, as that will rewrite all of the repositories you currently have in your personal GitHub account.</strong></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_05_50_45.Still024.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Select "Only select repositories", and find the repository which you have created for backing up your Hashnode blogs.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_06_14_16.Still025.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Simply click and select the repository.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_06_19_37.Still026.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>If everything is okay, then you can click "Install &amp; Authorize", <strong>but again</strong> <strong>keep in mind that you must not select All repositories.</strong></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_06_39_58.Still029.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Provide your GitHub account's password if it asks for that.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_06_42_26.Still030.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>If will redirect you to Hashnode to continue the installation process.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_06_47_38.Still031.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You've now created your automatic backup. If you want to back up the existing posts, then you have to click "Back up all my posts".</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_07_31_47.Still032.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>It will backup every post you had before creating the automatic backup.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_07_33_09.Still033.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_07_38_56.Still034.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Now, if you simply refresh the GitHub repo webpage (the repo you created only for backing up this Hashnode blog), you will see that it has been updated as well!</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_07_59_50.Still036.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You can even read the article directly from your backed up repo.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/05/2022-04-28-13-42-26.00_08_02_00.Still037.jpg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>That's it! </p>
<p>If you want to watch a video that covers the whole process, then you can check out the following video that I made:</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/a2PZPR9ul6c" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Thanks for reading the entire article. If it helps you then you can also check out other articles of mine at <a target="_blank" href="https://www.freecodecamp.org/news/author/fahimbinamin/">freeCodeCamp</a>.</p>
<p>If you want to get in touch with me, then you can do so using <a target="_blank" href="https://twitter.com/Fahim_FBA">Twitter</a>, <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>, and <a target="_blank" href="https://github.com/FahimFBA">GitHub</a>. </p>
<p>You can also <a target="_blank" href="https://www.youtube.com/@FahimAmin?sub_confirmation=1">SUBSCRIBE to my YouTube channel</a> (Code With FahimFBA) if you want to learn various kinds of programming languages with a lot of practical examples regularly.</p>
<p>If you want to check out my highlights, then you can do so at my <a target="_blank" href="https://www.polywork.com/fahimbinamin">Polywork timeline</a>.</p>
<p>You can also <a target="_blank" href="https://fahimbinamin.com/">visit my website</a> to learn more about me and what I'm working on.</p>
<p>Thanks a bunch!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ External Hard Drive Not Showing Up? Disk Management in Windows 10 Tutorial ]]>
                </title>
                <description>
                    <![CDATA[ External hard drives let you back up your files. With external drives, you can also easily move files from one computer to another - especially when you get a new computer. But sometimes when you're trying to back up or retrieve files from an externa... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/external-hard-drive-not-showing-up-disk-management-in-windows-10-tutorial/</link>
                <guid isPermaLink="false">66adf0d56f5e63db3fc43603</guid>
                
                    <category>
                        <![CDATA[ Backup ]]>
                    </category>
                
                    <category>
                        <![CDATA[ beginners guide ]]>
                    </category>
                
                    <category>
                        <![CDATA[ how-to ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kolade Chris ]]>
                </dc:creator>
                <pubDate>Mon, 15 Nov 2021 20:37:30 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/11/martin-may-2CehLl3d8Ak-unsplash--2-.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>External hard drives let you back up your files. With external drives, you can also easily move files from one computer to another - especially when you get a new computer.</p>
<p>But sometimes when you're trying to back up or retrieve files from an external hard drive, the drive might not show up. There are several possible reasons for this, like lack of power, faulty drivers, or hardware issues. </p>
<p>In this guide, I will show you 5 ways you can fix an external drive not showing up.</p>
<h2 id="heading-how-to-fix-your-external-hard-drive-not-showing-up-by-plugging-it-in">How to Fix Your External Hard Drive Not Showing Up by Plugging it In</h2>
<p>Your hard drive might not show up because it has little or no power supply to it. </p>
<p>A lot of hard drives are optimized to receive their power supply through USB ports, while some others have separate power sources.</p>
<p>If you're using one that gets power through a USB port, it'll have a light (usually blue) that indicates that it's receiving power. If this light isn't turned on, it means the hard drive isn't receiving power.</p>
<p>If this is the case, you should make sure the USB cord fits in correctly, or you can try another USB port.</p>
<h2 id="heading-how-to-fix-your-external-hard-drive-not-showing-up-by-trying-another-usb-port-or-computer">How to Fix Your External Hard Drive Not Showing Up by Trying Another USB Port or Computer</h2>
<p>Computers usually come with up to 3 USB ports, or at least 2. So, if your external hard drive is not showing up while plugged into a particular USB port, you should try another one.</p>
<p>You can also try using your external hard drive on another computer in case your computer has faulty drivers or damaged USB ports. If the hard drive works on another machine, you can look into fixing your computer.</p>
<h2 id="heading-how-to-fix-your-external-hard-drive-not-showing-up-by-updating-drivers">How to Fix Your External Hard Drive Not Showing Up by Updating Drivers</h2>
<p>If your external hard drive fails to show up on your computer, you can try updating or reinstalling your computer's USB drivers. </p>
<p>Follow these steps to update your USB drivers:</p>
<p><strong>Step 1</strong>: Right-click on Start (Windows logo) and select "Device Manager". You can also launch Device Manager by searching for it and then clicking on the "Device Manager" search result.
<img src="https://www.freecodecamp.org/news/content/images/2021/11/ss-1-8.jpg" alt="ss-1-8" width="600" height="400" loading="lazy"></p>
<p><strong>Step 2</strong>: Expand the Disk drives option.
<img src="https://www.freecodecamp.org/news/content/images/2021/11/ss-2-7.jpg" alt="ss-2-7" width="600" height="400" loading="lazy"></p>
<p><strong>Step 3</strong>: Right-click on the device and select "Update drivers".
<img src="https://www.freecodecamp.org/news/content/images/2021/11/ss-3-7.jpg" alt="ss-3-7" width="600" height="400" loading="lazy"></p>
<p><strong>Step 4</strong>: Choose "Search automatically for driver software".
<img src="https://www.freecodecamp.org/news/content/images/2021/11/ss-4-8.jpg" alt="ss-4-8" width="600" height="400" loading="lazy"></p>
<p>Windows will now search online for driver updates and install them on your computer.</p>
<h2 id="heading-how-to-fix-your-external-hard-drive-not-showing-up-by-changing-the-drive-letter-in-disk-management">How to Fix Your External Hard Drive Not Showing Up by Changing the Drive Letter in Disk Management</h2>
<p>On almost all cases, Windows automatically assigns all external drives an appropriate letter. </p>
<p>If the hard drive hasn't been assigned one, it will not show up, so you need to do it yourself. And even if it's already assigned a letter, changing it might resolve the issue for you.</p>
<p>Follow the steps below to assign your hard drive a letter:</p>
<p><strong>Step 1</strong>: Right-click on Start (Windows logo) and select "Disk Management".
<img src="https://www.freecodecamp.org/news/content/images/2021/11/ss-5-6.jpg" alt="ss-5-6" width="600" height="400" loading="lazy"></p>
<p><strong>Step 2</strong>: Right-click on the external hard drive and select "Change Drive Letter and Paths…".
<img src="https://www.freecodecamp.org/news/content/images/2021/11/ss-6-7.jpg" alt="ss-6-7" width="600" height="400" loading="lazy"></p>
<p><strong>Step 3</strong>: If the drive has an existing letter, then click "Change".
<img src="https://www.freecodecamp.org/news/content/images/2021/11/ss-7-3.jpg" alt="ss-7-3" width="600" height="400" loading="lazy"></p>
<p><strong>Step 4</strong>: Select your preferred letter from the drop-down menu.
<img src="https://www.freecodecamp.org/news/content/images/2021/11/ss-8-1.png" alt="ss-8-1" width="600" height="400" loading="lazy"></p>
<p><strong>Step 5</strong>: Click Ok, then Ok again.</p>
<h2 id="heading-how-to-fix-your-external-hard-drive-not-showing-up-by-formatting-the-hard-drive-in-disk-management">How to Fix Your External Hard Drive Not Showing Up by Formatting the Hard Drive in Disk Management</h2>
<p>Formatting is a common way of fixing issues with external disks, so when your hard drive refuses to show up, you should try formatting it.</p>
<p>Be aware that formatting the external drive will erase all the data in it – so this may not be a viable or your first option if your drive is full of data.</p>
<p>The steps below will help you format your external hard drive.</p>
<p><strong>Step 1</strong>: Right-click on Start (Windows logo) and click on "Disk Management".
<img src="https://www.freecodecamp.org/news/content/images/2021/11/ss-5-6.jpg" alt="ss-5-6" width="600" height="400" loading="lazy"></p>
<p><strong>Step 2</strong>: Right-click on your drive and select "Format".
<img src="https://www.freecodecamp.org/news/content/images/2021/11/ss-9-2.jpg" alt="ss-9-2" width="600" height="400" loading="lazy"></p>
<p><strong>Step 4</strong>: Click "Ok" to run the format.
<img src="https://www.freecodecamp.org/news/content/images/2021/11/ss-10-3.jpg" alt="ss-10-3" width="600" height="400" loading="lazy"></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>In this article you learned 5 different ways you can get your hard drive to show up when you plug it into your computer. </p>
<p>In addition to the fixes suggested in this article, consider updating Windows 10 as well because it fixes a lot of issues.</p>
<p>If you find this article helpful, don't hesitate to share it with your friends and loved ones so they can confidently fix this issue in case they experience it.</p>
<p>Thank you for reading.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Why Backing Up Your Data Is Important for IT Security ]]>
                </title>
                <description>
                    <![CDATA[ Early one recent morning my Linux workstation failed to boot. And just like that, all my work plans for the day ground to an immediate halt. This was the Linux workstation that was host to thirty years-worth of data: The original working drafts of al... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/it-security-and-data-backups/</link>
                <guid isPermaLink="false">66b995ff3cd81de09c96b28e</guid>
                
                    <category>
                        <![CDATA[ Backup ]]>
                    </category>
                
                    <category>
                        <![CDATA[ cybersecurity ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data ]]>
                    </category>
                
                    <category>
                        <![CDATA[ information security ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Security ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ David Clinton ]]>
                </dc:creator>
                <pubDate>Wed, 06 Jan 2021 18:55:04 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/01/backup-recovery.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Early one recent morning my Linux workstation failed to boot. And just like that, all my work plans for the day ground to an immediate halt.</p>
<p>This was the Linux workstation that was host to thirty years-worth of data: The original working drafts of all my books. The master versions of my course videos. My tax records, banking information, password vault, and the access keys to my cloud infrastructure.</p>
<p>Was I surprised? Not particularly. The day before I’d been struggling with a broken Python package and I knew there was a chance it wouldn’t end well the next time I fired up the machine.</p>
<p>Was I annoyed? Yup.</p>
<p>Did I break into a cold sweat, thinking about what was lost and whether I’d ever recover? Nope. That was never a concern. </p>
<p>In fact, from the moment I decided that the original installation was no longer worth fighting for, it would only take an hour or so to get everything back up and running. (Not counting the time it took me to remember that a known hardware conflict required I disable a non-free Nvidia driver.)</p>
<p>Let me emphasise that: I erased the corrupted drive, installed a clean copy of Ubuntu Linux, and wrote fresh, reliable copies of around 20GB of data to the new installation in less than a single hour.</p>
<p>Besides having a fast fibre optics internet connection, what’s my secret sauce? I’m constantly backing up all my important data to multiple storage locations. When catastrophe hits, I have a solid, tested recovery protocol in place. </p>
<p>For all intents and purposes, the workstation part of that protocol involves installing my OS and then, with just two or three commands, restoring all my data to its new home. From that moment, I’ll be back to work.</p>
<p>I’m sure this story has left you overcome with relief and warm, sympathetic feelings. But what’s it all got to do with IT security? More than you might imagine. </p>
<p>The fact is that there many reasons backup discussions belong here, but if you had to limit yourself to just one, this common and timely scenario (adapted from my recent “<a target="_blank" href="https://www.amazon.com/dp/1119781469">Linux Security Fundamentals” book from Wiley/Sybex</a>) would be it:</p>
<blockquote>
<p><em>Imagine you’re responsible for the IT systems powering the municipal services for your small town. Without those computers and their data, municipal workers won’t get paid next month, the local library won’t know where any of their books are, the 911 emergency service communication system’s phones won’t ring, and the town’s information website will go offline.</em></p>
<p><em>Now imagine that one fine morning you log into the main server and you’re greeted by the cheerful news that all the data on your systems has been encrypted by a hacker from Eastern Europe and that they won’t give you the decryption key to restore your access unless you pay them a couple hundred thousand dollars’ worth of cryptocurrency. Don’t think this is realistic? Major hospitals, utilities, and entire small cities have been brought to their knees by just such attacks.</em></p>
<p><em>What are your choices?</em></p>
</blockquote>
<ul>
<li><em>You could pay the ransom and hope the attackers keep their promise to decrypt your data. But, historically, they often haven’t. Criminals aren’t known for being honest.</em></li>
<li><em>You could try using decryption tools provided by major security companies and government agencies (like</em> <a target="_blank" href="https://noransom.kaspersky.com/"><em>https://noransom.kaspersky.com/</em></a> <em>) and hope that they’ll work on your system. This is certainly a valid option, but it won’t work in all cases.</em></li>
<li><em>You could wipe your systems clean and rebuild everything from scratch. This could be hugely expensive and take months to complete.</em></li>
</ul>
<blockquote>
<p><em>But do you know how you can stop the attack cold and walk away virtually untouched? If you had complete, up-to-date backup copies of your systems (both the user data and the application systems themselves), then all you’ll need to do is rebuild from your backups.</em></p>
<p><em>Worst case, you’re down for an hour or two, and few people even notice. Even better, you could plan things really well by designing an always-running “hot” backup infrastructure that’s preconfigured to go live the minute the main system goes down. It’s known as failover, and it’s the kind of plan that can make you a big hero and earn you a big raise.</em></p>
<p><em>Still not sure what backups have to do with security?</em></p>
</blockquote>
<p>That Linux Security Fundamentals book also describes how to properly assemble all the parts your recovery plan will need. That’ll include a careful assessment of precisely how important your data is to both you and the organization you work for. </p>
<p>Here’s how my book describes RTOs and RPOs:</p>
<blockquote>
<p><em>How “quick” is quick enough and how “complete” is complete enough? That will depend on your organization’s operational needs. It’s common for administrators to measure their needs in terms of a recovery point objective (RPO) and recovery time objective (RTO). An RPO is the system state you need to be able to recover that will be current enough for your organization’s minimum requirements. So, for instance, if your recovered system will have data that includes all but the last hour preceding the crash, you’ll be able to get by. But a loss of two hours of data would be catastrophic; the financial or reputation loss you’d face would be too serious. For such an organization, you’d better make sure you have an RPO of one hour or less.</em></p>
<p><em>An RTO, on the other hand, is a measure of how soon you need to get your system back up and running at full speed before really bad things start happening to your organization.</em></p>
<p><em>By way of example, suppose your ecommerce site was offline for 12 hours. You’ll lose some business, obviously, but your business analysts tell you that anything up to 48 hours is still livable. More than 48 hours, however, and customers will assume you’re down for good and head over to the competition (which, all things being equal, will be Amazon).</em></p>
<p><em>Therefore, when you plan your backup regimen, you’ll take both the RPO and the RTO into account. You’ll need to make sure a new backup is run within the RPO (say, one hour) and also make sure you can access your backup archives and successfully restore the data to the applications in less than the RTO (48 hours, in our example).</em></p>
</blockquote>
<p>Sure, RTOs and RPOs are usually applied to enterprise infrastructure workloads. But, on many levels, the underlying point can also apply to our own beloved workstations and laptops.</p>
<p>If you take some time now — today — to plan, create, and test your own recovery protocol, you can be sure that one day soon, you’ll thank yourself.</p>
<p><em>You can find much more technology content by</em> <a target="_blank" href="https://bootstrap-it.com/davidclinton"><em>David Clinton through his website.</em></a> <em>In particular, you might enjoy his new book,</em> <a target="_blank" href="https://www.amazon.com/gp/product/B08HL9WQ1H/"><em>Keeping Up: Backgrounders to all the big technology trends you can’t afford to ignore</em></a><em>.</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Import a Sample Database to your AWS RDS Microsoft SQL Server using S3 ]]>
                </title>
                <description>
                    <![CDATA[ By Clark Jason Ngo This guide was created because it was so hard to find a way to play around with a sample database using AWS RDS MSSQL Server. I hope you find this helpful. If you haven't set up your AWS RDS Microsoft SQL Server and Azure Data Stud... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/cjn-how-to-import-a-sample-database-to-your-aws-rds-microsoft-sql-server-using-s3/</link>
                <guid isPermaLink="false">66d45e0e3dce891ac3a967de</guid>
                
                    <category>
                        <![CDATA[ mssql ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Azure ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Backup ]]>
                    </category>
                
                    <category>
                        <![CDATA[ database ]]>
                    </category>
                
                    <category>
                        <![CDATA[ S3 ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sun, 29 Mar 2020 10:13:35 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/03/Screen-Shot-2020-03-29-at-3.12.23-AM.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Clark Jason Ngo</p>
<p>This guide was created because it was so hard to find a way to play around with a sample database using AWS RDS MSSQL Server. I hope you find this helpful.</p>
<p>If you haven't set up your AWS RDS Microsoft SQL Server and Azure Data Studio, check this guide first: <em><a target="_blank" href="https://www.freecodecamp.org/news/cjn-how-to-connect-your-aws-rds-microsoft-sql-server-using-azure-data-studio/">How to Connect your AWS RDS Microsoft SQL Server using Azure Data Studio</a></em>.</p>
<p>We will be touching the technologies shown below:  </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-244.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ul>
<li>Database: AWS RDS Microsoft SQL Server Express Edition</li>
<li>Database tool and GUI: Azure Data Studio</li>
<li>Sample database backup copy: Amazon S3 Bucket</li>
</ul>
<h2 id="heading-adventureworks-sample-database-backup-copy">AdventureWorks sample database backup copy</h2>
<p>To get the OLTP downloads of AdventureWorks, go to this <a target="_blank" href="https://docs.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sql-server-ver15">link</a> and choose any sample database. In my example, I choose <code>AdventureWorks2017.bak</code>. We will upload this to the S3 Bucket.</p>
<h2 id="heading-amazon-s3-bucket">Amazon S3 Bucket</h2>
<h3 id="heading-creating-the-s3-bucket">Creating the S3 Bucket</h3>
<ol>
<li>Create a bucket. You can choose any bucket name (example: yourname-sample-dbs).</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-202.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="2">
<li>Make sure the region is same as the AWS RDS instance. </li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-203.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="3">
<li><p>Tick the following checkboxes:</p>
</li>
<li><p>Block public access to buckets and objects granted through <em>new</em> access control lists (ACLs)</p>
</li>
<li>Block public access and objects granted through <em>any</em> access control lists (ACLs)</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-204.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="4">
<li>Access your bucket again by clicking on your created bucket.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-205.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-uploading-the-file-to-the-s3-bucket">Uploading the file to the S3 bucket</h3>
<ol>
<li>Click <strong>Upload</strong>.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-206.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="2">
<li>Choose the database backup file. For example: <code>AdventureWorks2017.bak</code>. Keep choosing <strong>Next</strong> and choose <strong>Upload</strong> at the Review section.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-207.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="3">
<li>Update your Bucket Policy to allow access to your S3 Bucket. Note that your ARN will differ to mine. Hit <strong>Save</strong> afterwards.</li>
</ol>
<pre><code class="lang-json">{
    <span class="hljs-attr">"Version"</span>: <span class="hljs-string">"2012-10-17"</span>,
    <span class="hljs-attr">"Id"</span>: <span class="hljs-string">"Policy1548223592786"</span>,
    <span class="hljs-attr">"Statement"</span>: [
        {
            <span class="hljs-attr">"Sid"</span>: <span class="hljs-string">"Stmt1548223591553"</span>,
            <span class="hljs-attr">"Effect"</span>: <span class="hljs-string">"Allow"</span>,
            <span class="hljs-attr">"Principal"</span>: <span class="hljs-string">"*"</span>,
            <span class="hljs-attr">"Action"</span>: <span class="hljs-string">"s3:GetObject"</span>,
            <span class="hljs-attr">"Resource"</span>: <span class="hljs-string">"arn:aws:s3:::changethis/*"</span>
        }
    ]
}
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-208.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-aws-rds-mssql-server-express">AWS RDS - MSSQL Server Express</h2>
<h3 id="heading-creating-an-option-group-for-your-rds-instance">Creating an Option Group for your RDS instance</h3>
<ol>
<li>Click <strong>Option groups</strong>,</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-194.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="2">
<li>Create an option group. Choose any name and description. For the Engine, it should match your RDS instance. In my example, I used SQL Server Express Edition so I choose <code>sqlserver-ex</code>.</li>
</ol>
<p>Here are the following Engines and their abbreviations:</p>
<ul>
<li>SQL Server Enterprise Edition: <code>sqlserver-ee</code></li>
<li>SQL Server Standard Edition: <code>sqlserver-se</code></li>
<li>SQL Server Web Edition: <code>sqlserver-web</code></li>
<li>SQL Server Express Edition: <code>sqlserver-ex</code></li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-195.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="3">
<li>Once you have created the option group, you'll need to <strong>Add option</strong>.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-199.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="4">
<li>Choose <strong>SQLSERVER_BACKUP_RESTORE</strong> for your Option name. For the IAM role, it is best to create a new role.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-200.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="5">
<li>Choose the S3 bucket where your database file is hosted. For scheduling, choose <strong>Immediately</strong>.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-201.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="6">
<li>Go back to your AWS RDS MSSQL Server instance and click <strong>Modify</strong>.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-196.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="7">
<li>Choose the created option group with <code>sql-server-express-backup</code>, then Click Continue.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-197.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="8">
<li>Choose to <strong>Apply immediately</strong> for scheduling of modifications. </li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-198.png" alt="Image" width="600" height="400" loading="lazy"></p>
<ol start="9">
<li>Go back to your AWS RDS MSSQL Server instance page and scroll down and modify <em>Manage IAM Roles</em>. Add the IAM role you have created in S3. For the Feature, choose <strong>S3_INTEGRATION</strong>. </li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-210.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-211.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-azure-data-studio">Azure Data Studio</h2>
<h3 id="heading-importing-the-sample-database-in-s3-bucket-through-restore-function">Importing the sample database in S3 bucket through restore function</h3>
<ol>
<li>In your connected AWS RDS MSSQL Server, create a new query and type in the following:</li>
</ol>
<pre><code class="lang-sql">exec msdb.dbo.rds_restore_database 
@restore_db_name='AdventureWorks-test', 
@s3_arn_to_restore_from='arn:aws:s3:::clark-sample-dbs/AdventureWorks2017.bak';
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-209.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Refresh your Azure Data Studio. Also, try restarting the application if your database did not appear or don't have permission to access it.</p>
<p>Now you are done! Good job! ???</p>
<p>Resources:</p>
<ul>
<li><a target="_blank" href="https://aws.amazon.com/premiumsupport/knowledge-center/native-backup-rds-sql-server/">https://aws.amazon.com/premiumsupport/knowledge-center/native-backup-rds-sql-server/</a></li>
</ul>
<p>Connect with me on LinkedIn <a target="_blank" href="https://www.linkedin.com/in/clarkngo/">here</a></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/03/image-243.png" alt="Image" width="600" height="400" loading="lazy"></p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
