Help - Search - Members - Calendar
Full Version: Mysql Crashed, How Do I Restore The Database
Movable Type Community Forum > Installing and Upgrading > Databases
Fred Sommer
Our webhost had problems with their MySQL server and in the process of moving everything over to a new server lost our database. There is no back-up available. Our MT installation is on another server so it is intact.

Is there anyway to recreate or restore the database from the existing archives? The blog is fairly new so I only have a couple of months of posts to deal with.

I assume I could re-create the blogs and clip and paste all the posts and republish them, but I'm hoping there is a better solution.

Any help anyone could offer would be appreciated.

Thanks!

Fred


Blogs - Sommer Gardens and Fred's Blog
imabug
QUOTE (Fred Sommer @ Dec 26 2007, 03:57 PM) *
Is there anyway to recreate or restore the database from the existing archives? The blog is fairly new so I only have a couple of months of posts to deal with.


you could try the script in this post. it was written back in the MT2.x days so it will likely require some modification to parse your archives properly.

The weird  characters are supposed to be tabs I think.
Fred Sommer
QUOTE (imabug @ Dec 26 2007, 06:37 PM) *
you could try the script in this post. it was written back in the MT2.x days so it will likely require some modification to parse your archives properly.

The weird  characters are supposed to be tabs I think.


Thanks!

Things have changed now. My host was able to provide me a dump of the MySQL database. When he copied the database over to the new server, MT would not recognize it. I verified all the settings were correct in the mt-config file. I just created a new database and was going to try again. Not knowing much about MySQL, I do not know how to get this data back into the database. Should I use MT to initialize the database before pulling the data in?

Here is how the MySQL file they sent me starts out. It was sent as a text file.

/*
SQLyog Community Edition- MySQL GUI v6.01
Host - 5.0.41-community-nt : Database - sommersports
*********************************************************************
Server version : 5.0.41-community-nt
*/
/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

create database if not exists `sommersports`;

USE `sommersports`;

/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

/*Table structure for table `mt_asset` */

DROP TABLE IF EXISTS `mt_asset`;

CREATE TABLE `mt_asset` (
`asset_id` int(11) NOT NULL auto_increment,
`asset_blog_id` int(11) NOT NULL,
`asset_class` varchar(255) default 'file',
`asset_created_by` int(11) default NULL,
`asset_created_on` datetime default NULL,
`asset_description` mediumtext,
`asset_file_ext` varchar(20) default NULL,
`asset_file_name` varchar(255) default NULL,
`asset_file_path` varchar(255) default NULL,
`asset_label` varchar(255) default NULL,
`asset_meta` mediumblob,
`asset_mime_type` varchar(255) default NULL,
`asset_modified_by` int(11) default NULL,
`asset_modified_on` datetime default NULL,
`asset_parent` int(11) default NULL,
`asset_url` varchar(255) default NULL,
PRIMARY KEY (`asset_id`),
KEY `mt_asset_parent` (`asset_parent`),
KEY `mt_asset_file_path` (`asset_file_path`),
KEY `mt_asset_created_on` (`asset_created_on`),
KEY `mt_asset_url` (`asset_url`),
KEY `mt_asset_blog_id` (`asset_blog_id`),
KEY `mt_asset_label` (`asset_label`),
KEY `mt_asset_class` (`asset_class`),
KEY `mt_asset_created_by` (`asset_created_by`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Data for the table `mt_asset` */

etc.

How do I bring this back into MySQL and enable my blog to function again?

Thanks.

Fred
imabug
Check with your host provider to see what kind of MySQL interface they provide (like phpMyAdmin or something similar). You should be able to use it to feed the SQL dump to MySQL and have it recreate your blog DB. Once that's done, your MT should be back and running like it was before the crash.
vijay
I am also suffering with the same problem.So can u provide me a link which ould help me and define me about how restore the database.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.