# How does one get a tar.gz file in Amazon S3 to restore a server database?

**URL:** <https://www.ruby-forum.com/t/how-does-one-get-a-tar-gz-file-in-amazon-s3-to-restore-a-server-database/132159>\
**Category:** Deployment\
**Created:** [March 17, 2008, 2:51pm UTC](https://www.ruby-forum.com/t/how-does-one-get-a-tar-gz-file-in-amazon-s3-to-restore-a-server-database/132159 "2008-03-17T14:51:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 17, 2008, 2:51pm UTC](https://www.ruby-forum.com/t/how-does-one-get-a-tar-gz-file-in-amazon-s3-to-restore-a-server-database/132159/1 "2008-03-17T14:51:46Z")

</div>

I expect the guys on this forum will laugh…but I have no clue about  
how I’d ever restore my backups on Amazon S3 if I ever had to?  
I’ve got phpAdmin loaded upon my server and can access it except I get  
this error message:

" The mbstring PHP extension was not found and you seem to be using a  
multibyte charset. Without the mbstring extension phpMyAdmin is unable  
to split strings correctly and it may result in unexpected results.  
Your PHP MySQL library version 4.1.22 differs from your MySQL server  
version 5.0.45. This may cause unpredictable behavior. "

As I use a Windows XP machine I expect I’ll be extracting this tar.gz  
file somewhere and then running some type of routine to restore the  
database. In Windows I use MySQL Administrator if I have to backup or  
restore a database.

Can anyone explain the ‘big picture’ to me or point me where I can  
learn this?  
Thank you,  
Kathleen

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 17, 2008, 6:42pm UTC](https://www.ruby-forum.com/t/how-does-one-get-a-tar-gz-file-in-amazon-s3-to-restore-a-server-database/132159/2 "2008-03-17T18:42:48Z")

</div>

Hello Kathleen.

The way you’d restore the backup is entirely dependent on how the  
backup was made.

I’ll offer some generalities here, which may or _may not_ be helpful.

1. There’s a good chance that the S3 backup is a mysqldump file. This  
means that it is a SQL file which can be run executed by MySQL to  
restore your database.
2. If that’s the case, you need to get it from S3 to your MySQL  
server, or any machine which has access to your MySQL server.
3. To do this, you could use an S3 browser program. Take a look at:

[https://addons.mozilla.org/en-US/firefox/addon/3247](https://addons.mozilla.org/en-US/firefox/addon/3247)  
[http://www.bucketexplorer.com/](http://www.bucketexplorer.com/)

Please note that I just found these via Google and cannot vouch for  
either.

1. Once you’ve installed and configured such a beast, you’d use the  
program to download the file to your Windows system.
2. Send the file to your MySQL server or a server with access to your  
MySQL server. You might use SCP or SFTP to do this.
3. Log into the server your put the file on via SSH.
4. Run a series of commands like:

7a) tar xfz backup.tar.gz  
7b) mysql -u “username” -p “password” -h “hostname” \< backup.sql

Working blind, lots of things here, mostly filenames and pathnames  
could be an issue, but this gives you a general sense of the  
procedure.

On Mar 17, 6:50 am, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 18, 2008, 3:47pm UTC](https://www.ruby-forum.com/t/how-does-one-get-a-tar-gz-file-in-amazon-s3-to-restore-a-server-database/132159/3 "2008-03-18T15:47:44Z")

</div>

Mr. Mornini,  
You are a prince and have presumptive powers far greater than mortal  
man!  
Yes. This is a MySQL dump into a tar.gz file and I do use  
BucketExplorer (and love it). I also use WinSCP to allow access to my  
server in a secure fashion.  
So I would copy the tar.gz file using these tools and then extract to  
some predetermined location.  
Then I assume the restored tar.gz file is called ‘backup.sql’ in your  
example and I’d run the;  
mysql -u “username” -p “password” -h “hostname” \< backup.sql  
I am most grateful for your kind reply.  
Kathleen

On Mar 17, 10:41 am, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
