how to use the backup file .mysql to restore the data

Shilpa Kothari's picture

Hi All,
I reinstalled xampp and and also install the drupal 7 into it.
I wanted to use my backup (.mysqlfile).But when try to import this file in drupal database using phpmyadmin it shows

CREATE TABLE accesslog ( aid int(11) NOT NULL AUTO_INCREMENT COMMENT 'Primary Key: Unique accesslog ID.', sid varchar(128) NOT NULL DEFAULT '' COMMENT 'Browser session ID of user that visited page.', title varchar(255) DEFAULT NULL COMMENT 'Title of page visited.', path varchar(255) DEFAULT NULL COMMENT 'Internal path to page visited (relative to Drupal root.)', url text COMMENT 'Referrer URI.', hostname varchar(128) DEFAULT NULL COMMENT 'Hostname of user that visited the page.', uid int(10) unsigned DEFAULT '0' COMMENT 'User users.uid that visited the page.', timer int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Time in milliseconds that the page took to load.', timestamp int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Timestamp of when the page was visited.', PRIMARY KEY (aid), KEY accesslog_timestamp (timestamp), KEY uid (uid) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stores site access information for statistics.' AUTO_INCREM[...]

MySQL said:

1050 - Table 'drupal.accesslog' already exists

when I login into localhost/drupal
it shows following error.
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.semaphore' doesn't exist: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 167 of C:\xampp\htdocs\drupal\includes\lock.inc)...

Please let me knoe exact way to use the back file.

Thank you
Gyan.

Comments

database not fully imported

mikaoelitiana's picture

I think you database is just no fully imported. How did you import it? Did you copy and paste the .mysql file or juste imported tables from a .sql file?

using module backup and migrate

Shilpa Kothari's picture

Thanks for your reply.

Let me start again.
my drupal site crashed for some reason so I reinstalled everything (xampp,then adding drupal folder in htdocs .......).
Now I have new drupal site with no content added.

In last month I had used backup and migrate module to take back up of my site.
It got stored as mysql file size 1.14MB.
Now if have to use this file how should I do it.
Please let me know the procedure.

Thank you.

You are seeing Partial import errors

headdragon's picture

To import you can't have data in the database. That is this error. 1050 - Table 'drupal.accesslog' already exists.
All your errors point to a SQL database missing data and some data already in there.
Ignore all the errors. How big is the Drupal file? To large an import no matter what mySQL says is the max limit can get lost during transfer. I have imported one data base single field and structure group at a time.

Like this you must have both the top information and the bottom ending line of dashes.

-- Table structure for table `views_view`
--

DROP TABLE IF EXISTS `views_view`;
CREATE TABLE IF NOT EXISTS `views_view` (
  `vid` int(10) unsigned NOT NULL auto_increment COMMENT 'The view ID of the field, defined by the database.',
  `name` varchar(32) NOT NULL default '' COMMENT 'The unique name of the view. This is the primary field views are loaded from, and is used so that views may be internal and not necessarily in the database. May only be alphanumeric characters plus underscores.',
  `description` varchar(255) default '' COMMENT 'A description of the view for the admin interface.',
  `tag` varchar(255) default '' COMMENT 'A tag used to group/sort views in the admin interface',
  `base_table` varchar(64) NOT NULL default '' COMMENT 'What table this view is based on, such as node, user, comment, or term.',
  `human_name` varchar(255) default '' COMMENT 'A human readable name used to be displayed in the admin interface',
  `core` int(11) default '0' COMMENT 'Stores the drupal core version of the view.',
  PRIMARY KEY  (`vid`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Stores the general data for a view.' AUTO_INCREMENT=28 ;

--
-- Dumping data for table `views_view`
--

INSERT INTO `views_view` (`vid`, `name`, `description`, `tag`, `base_table`, `human_name`, `core`) VALUES
(1, 'events_upcoming', '', 'default', 'node', 'Events - Upcoming', 7),
(2, 'products_by_player', 'Display a list of products for store admin.', 'commerce', 'commerce_product', 'Products by Player', 0),
(3, 'coa_by_id', '', 'default', 'node', 'COA by ID', 7),
(4, 'past_events_image_page', '', 'default', 'node', 'Past Events Image Page', 7),
(5, 'slideshow', '', 'default', 'node', 'Slideshow', 7),
(6, 'daily_sale_item_block', '', 'default', 'commerce_product', 'Daily Sale Item Block', 7),
(7, 'article_teasers', 'Basic Blog Functionality', 'default', 'node', 'Article Teasers', 7),
(8, 'taxonomy_term', 'A view to emulate Drupal core''s handling of taxonomy/term.', 'default', 'node', 'Taxonomy term', 7),
(9, 'commerce_products', 'Display a list of products for store admin.', 'commerce', 'commerce_product', 'Products', 0),
(10, 'features', '', 'default', 'node', 'Features, Preorders, Daily Sale Block', 7),
(11, 'player_select_block', '', 'default', 'taxonomy_term_data', 'Player Select Block', 7),
(12, 'commerce_orders', 'Display a list of orders for the store admin.', 'commerce', 'commerce_order', 'Orders', 0),
(13, 'orders_with_payment_status', '', 'default', 'commerce_payment_transaction', 'Report: Open Retail Orders', 7),
(14, 'report_product_sales_by_event', '', 'default', 'commerce_line_item', 'Report:  Product Sales by Event', 7),
(15, 'clone_of_report_product_sales_by', '', 'default', 'commerce_line_item', 'Report: Orders by Customer', 7),
(16, 'customers_by_n_orders', '', 'default', 'commerce_order', 'Report: Customers by N-orders', 7),
(17, 'sales_by_time_period', '', 'default', 'commerce_line_item', 'Report: Sales by Time Period', 7),
(18, 'report_sales_by_month', '', 'default', 'commerce_line_item', 'Report: Sales by Month', 7),
(19, 'products_sold_at_events', '', 'default', 'commerce_product', 'Products sold at events', 7),
(20, 'commerce_cart_block', 'Display a list of line items added to cart.', 'commerce', 'commerce_order', 'Shopping cart block', 0),
(21, 'blog_tags', '', 'default', 'node', 'Blog Tags', 7),
(22, 'list_of_blog_categories', '', 'default', 'taxonomy_term_data', 'List of Blog Categories', 7),
(23, 'popfe', '', 'default', 'node', 'Pre-Order Products for Events', 7),
(24, 'commerce_cart_summary', 'Cart line item summary displayed during checkout.', 'commerce', 'commerce_order', 'Shopping cart summary', 0),
(25, 'custom_customer_order_page', '', 'default', 'commerce_order', 'Custom Customer Order Page', 7),
(27, 'dropship', '', 'default', 'commerce_line_item', 'Dropship', 7);

-- --------------------------------------------------------

Head Dragon Kid Stevens
Of Web-DrupalDesign .com

using backup and migrate module

Shilpa Kothari's picture

Let me start again.
my drupal site crashed for some reason so I reinstalled everything (xampp,then adding drupal folder in htdocs .......).
Now I have new drupal site with no content added.

In last month I had used backup and migrate module to take back up of my site.
It got stored as mysql file size 1.14MB.
Now if have to use this file how should I do it.
Please let me know the procedure.

Thank you.

The backup file should from a

RKumar-dupe's picture

The backup file should from a time before the crash happened.

Case 1
1. Do not reinstall the drupal or delete anything.
2. Use php my admin and update the database with the backup file got from backup and migrate.
3. I should be working.

Case 2
2. if you did install drupal afresh (you should also have copied the sites folder with you during crash or before).
3. You should have saved the sites folder (in case not, load what themes and modules were there and set it and also copy the images that was on the site).
4. Use php my admin and update the database with the backup file got from backup and migrate.
5. You should be done and working now.

back up

Shilpa Kothari's picture

Thanks for your reply.
Please tell me the step by step procedure to be done when i am myphpadmin page.

Thanks again.

Once in PHP my admin 1. Click

RKumar-dupe's picture

Once in PHP my admin
1. Click on the database name of your site (you will get options like structure, SQL, search, export, import, drop....)
2. Click import
3. Click browse and select the backup file from its respective folder (the default if you did not change setting on backup and migrate would be C:\Documents and Settings\Administrator\My Documents\Downloads)
4. Make sure the "format of imported file" is set to SQL
5. Green tick mark is there at the "do not use AUTO_INCREMENT for zero values"
6. Click on "Go"
7. wait for few seconds to 3 minutes to finish.
8. That is it (done!)

vijayaraja's picture

Hi

First i was worked drupal7 on xammp. what i did exactly my drupal7 corrupt then i copied drupal7 to some other place then reinstall xampp then i paste it drupal7 inside of htdocs folder then i'm getting this error .How to rectify this problem i checked setting.php file it was created db username and password but i cannot edit settings.php file

when i go to my website am getting this error

Error

The website encountered an unexpected error. Please try again later.

Error messagePDOException: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) in lock_may_be_available() (line 167 of C:\xampp\htdocs\drupal7\includes\lock.inc).

This is my 167 line code in lock.inc

$lock = db_query('SELECT expire, value FROM {semaphore} WHERE name = :name', array(':name' => $name))->fetchAssoc();

Which Operating system you

vidhyaprakash85's picture

Which Operating system you use?

Windows 7 Proff

vijayaraja's picture

Windows 7 Proff

Drupal Coimbatore

Group organizers

Group events

Add to calendar

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: