vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Programming Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=188)
-   -   Backup/restore using phpMyAdmin/SSH (https://vborg.vbsupport.ru/showthread.php?t=106935)

Coders Shack 05-16-2007 06:51 AM

To login and backup a database in one line:
Code:

mysqldump --password=[password] -h [hostname] -u [username] [databasename] > [backupfile.sql]
To restore a database in one line:
Code:

mysql --password=[password] -h [hostname] -u [username] [database_to_restore] < [backupfile]

rooney72 06-20-2007 12:34 AM

I followed step by step the tutorial, SOmehow I might be doing something wrong.

When I imported my very small testing database onto a new server it said it succeeded. When I go into the forum page I expect to see the old members and old threads. Right? After all if I want to transfer my forum onto a new server, then what's the scope of backup.

But in my case NOT. I only see the freshly installed vbulletin on my new server but not the treads and users.

What am I doing wrong?

In just a few words: I want to export my data and transfer it on a new database/server so I won't lose anything from my old forum

Mazoo 07-22-2007 02:27 PM

That's very useful tutorial .. thanks Snake ...

I'm running a big forum ( DB =~ 2 GB )
and for security I need to know the SSH command that enables me to save a redundant copy of the database their ..
could anyone tell us about their experience in that field ?
And if by chance anyone made a SSH or Linux script or maybe Cron that's automate that process , I hope that I know about it ..

Regards ,

Snake 10-11-2007 01:16 PM

Quote:

Originally Posted by rooney72 (Post 1272138)
I followed step by step the tutorial, SOmehow I might be doing something wrong.

When I imported my very small testing database onto a new server it said it succeeded. When I go into the forum page I expect to see the old members and old threads. Right? After all if I want to transfer my forum onto a new server, then what's the scope of backup.

But in my case NOT. I only see the freshly installed vbulletin on my new server but not the treads and users.

What am I doing wrong?

In just a few words: I want to export my data and transfer it on a new database/server so I won't lose anything from my old forum

Did you try restoring the database via phpMyAdmin or SSH?

Quote:

Originally Posted by Mazoo (Post 1298263)
That's very useful tutorial .. thanks Snake ...

I'm running a big forum ( DB =~ 2 GB )
and for security I need to know the SSH command that enables me to save a redundant copy of the database their ..
could anyone tell us about their experience in that field ?
And if by chance anyone made a SSH or Linux script or maybe Cron that's automate that process , I hope that I know about it ..



Regards ,

Uhh I'm not really sure what you're talking about.

Masiello 10-26-2007 05:36 PM

Hello, please any other split tool DB a part BigDumb? That I tried some month a go
For some reason it dont works good for me, I need to remove some queries from my DB that block the importing process.

ryanj19 10-27-2007 11:33 PM

Quote:

Originally Posted by Rhoads (Post 893111)
I tried but i get a error:

Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect -/bin/bash-2.05b$

Whats the problem, i use the command from your post, with my user and database name.

I noticed someone asked this question, but it doesn't look like it got answered. Anyway, the MySQL command could be more complete. In some cases the server might not be localhost. Therefore, the command should look like this:

mysql -u MyUserName -p MyDBName -h mysql.myhost.com < /full/path/to/sqldump.sql

letsjoy 01-10-2008 02:34 AM

thanks for post

Raptor 01-12-2008 04:01 AM

for those with SSH access its very easy to backup and to compress (gzip took my DB from 1.4GB to 327MB - Took about 3 minutes

mysqldump --opt -Q -u <username> -p <database name> | gzip > database.sql.gz

to restore....

gunzip < database.sql.gz | mysql -u <username> -p <database name>

hope this is clear and helps someone out

Snake 01-18-2008 11:57 AM

Yeah, but I don't think most of the hosts out there provide SSH access especially when they're running a small forum. That's why the either way to backup and/or restore is by phpMyAdmin or some other SQL tool. Shell is pretty much useful for a very large forum.

You're quite welcome, letsjoy.

mokujin 10-22-2008 09:16 PM

Quote:

Originally Posted by Snake (Post 888072)
Step 4 - Restoring using SSH

Note: Some hosts do not offer SSH access, I suggest contacting your host and asking him/her if SSH access is enabled and if so the details. A good program to use for connecting via SSH is PuTTY (Get it at: http://www.chiark.greenend.org.uk/~sgtatham/putty/). Don't know how to use it? Search on Google for a tutorial.
  1. Connect to your host via SSH, login & run: mysql -u user -p dbname < {path}/backup.sql
  2. You will be asked to type out your password once you run that command, do so and click enter. It may take some time for it to respond, but once completed you should be brought back to where you started (bash/command line).
Congratulations! You have successfully restored your database using SSH.

That's basically it I think, I believe I have covered everything? Anything I missed? Comments or suggestions? Just let me know! Hope this tutorial was as useful to you as it is to me. :)

Thanks,
-Snake
www.metalgearforums.com

How does bash/command line. look like or what is it???

nickson 07-29-2009 10:29 AM

my host has 2mb of limited to upload sql, and my database is worth 22mb, how could i go about this now? I am noob for restoring :(

dr.msk 11-08-2009 06:51 PM

thanks

kabir 03-03-2010 07:04 AM

Quote:

Originally Posted by Coders Shack (Post 1248567)
To login and backup a database in one line:
Code:

mysqldump --password=[password] -h [hostname] -u [username] [databasename] > [backupfile.sql]
To restore a database in one line:
Code:

mysql --password=[password] -h [hostname] -u [username] [database_to_restore] < [backupfile]

I use This Command But Server Says Me

Quote:

gsmrapid@gsmrapid.com [~]# mysql --password=bH>-cgSlQ9d/ -h localhost -u gsmrapid_forum gsmrapid_forum < gsmrapid_forum.sql
-jailshell: -cgSlQ9d/: Is a directory
gsmrapid@gsmrapid.com [~]#

ehabfouad22 03-06-2010 07:25 PM

I've created a backup zipped file in (MYI, MYD, FRM) formats. Its size was about 120 MB. Then I created a backup of the same database through phpMyAdmin in a .sql format, with a size of 16 MB only! Does that mean that my backup with phpMyAdmin was incomplete? Or it's normal to have a .sql file with a size much less than the actual size of direct database files?

basketmen 09-21-2010 08:56 AM

guys i want to move to another host, i already backup the mysql using ssh and get the .sql file, downloading to computer, and i want to uploading to new host using ftp and restore it there using ssh too

my question is in uploading to new host using ftp part, do i need using ASCII mode or binary mode when uploading the .sql file?

almajrouh 11-27-2010 08:15 AM

my be use scrip like bigdump.php


All times are GMT. The time now is 04:15 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01324 seconds
  • Memory Usage 1,763KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete