Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => Install and Upgrade Help => Aiheen aloitti: moraidh - huhtikuu 05, 2011, 04:25:21 IP

Otsikko: Upload Backup?
Kirjoitti: moraidh - huhtikuu 05, 2011, 04:25:21 IP
I have changed domains and want to change the location of my forum, so i have just installed the latest version of SMF there.

How do I get the database backup I have downloaded of my old forum uploaded into my new one?

(I have only downloaded hte b/u from within SMF, not via MySQL)
Otsikko: Re: Upload Backup?
Kirjoitti: Illori - huhtikuu 05, 2011, 04:26:57 IP
have you read this How do I restore a database backup? (http://docs.simplemachines.org/index.php?topic=490.0) ?
Otsikko: Re: Upload Backup?
Kirjoitti: moraidh - huhtikuu 05, 2011, 04:33:15 IP
Thanks Ilori,

But do I have to export the old database via MySQL in the old domain first, or can I use MySQL to import what I backed up via SMF??
Otsikko: Re: Upload Backup?
Kirjoitti: Illori - huhtikuu 05, 2011, 04:34:37 IP
i would recommend you backup from phpmyadmin as sometimes the backup in smf admin panel does not backup everything.
Otsikko: Re: Upload Backup?
Kirjoitti: moraidh - huhtikuu 05, 2011, 04:43:20 IP
But won't that back up all the files from what is an outdated version of SMF, so when I try to back up, my latest version will be written over?
Otsikko: Re: Upload Backup?
Kirjoitti: Illori - huhtikuu 05, 2011, 04:44:21 IP
no phpmyadmin will just backup your database, as your files are not stored in your database.

How do I backup my database? (http://docs.simplemachines.org/index.php?topic=492.0)
Otsikko: Re: Upload Backup?
Kirjoitti: moraidh - huhtikuu 22, 2011, 05:32:39 IP
OK, I saved an SQL database using phpMy Admin of my old forum.

My new domain already has a database created, when I installed the newest version of SMF on it.

I tried importing the SQL d/b using the new domain's phpMyAdmin and got an error becuase it had a different db name.  I opened up the db and changed all instances of the old name to that of the new one, and got the following message:

Error

SQL query:

-- phpMyAdmin SQL Dump
-- version 2.9.1.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 22, 2011 at 09:59 PM
-- Server version: 3.23.58
-- PHP Version: 4.4.7
--
-- Database: `newname`
--
CREATE DATABASE `newname` ;

MySQL said: Documentation
#1007 - Can't create database 'newname'; database exists 


Thing is, I read the link you gave, and I can't change the name of the databse my host gave me.  Am I stuck??
Otsikko: Re: Upload Backup?
Kirjoitti: Illori - huhtikuu 22, 2011, 06:17:22 IP
remove the line create database `newname`; from the file.
Otsikko: Re: Upload Backup?
Kirjoitti: moraidh - huhtikuu 22, 2011, 06:32:30 IP
Ok thanks,

Now I get this!

Error

SQL query:

--
-- Dumping data for table `phpbb_words`
--
-- --------------------------------------------------------
--
-- Table structure for table `smf_attachments`
--
CREATE TABLE `smf_attachments` (
`ID_ATTACH` int( 10 ) unsigned NOT NULL AUTO_INCREMENT ,
`ID_THUMB` int( 10 ) unsigned NOT NULL default '0',
`ID_MSG` int( 10 ) unsigned NOT NULL default '0',
`ID_MEMBER` mediumint( 8 ) unsigned NOT NULL default '0',
`attachmentType` tinyint( 3 ) unsigned NOT NULL default '0',
`filename` tinytext NOT NULL ,
`size` int( 10 ) unsigned NOT NULL default '0',
`downloads` mediumint( 8 ) unsigned NOT NULL default '0',
`width` mediumint( 8 ) unsigned NOT NULL default '0',
`height` mediumint( 8 ) unsigned NOT NULL default '0',
PRIMARY KEY ( `ID_ATTACH` ) ,
UNIQUE KEY `ID_MEMBER` ( `ID_MEMBER` , `ID_ATTACH` ) ,
KEY `ID_MSG` ( `ID_MSG` )
) TYPE = MYISAM AUTO_INCREMENT =212;

MySQL said: Documentation
#1050 - Table 'smf_attachments' already exists
Otsikko: Re: Upload Backup?
Kirjoitti: Illori - huhtikuu 22, 2011, 07:03:12 IP
does this database have your smf in it already? if so you dont need to import anything.
Otsikko: Re: Upload Backup?
Kirjoitti: moraidh - huhtikuu 23, 2011, 11:28:44 AP
I think you misunderstood.  Old Site A has my SMF forum and I want to move it to Site B.

I have installed the latest version of SMF on Site B (clean installation, with no data).

I want to move the database with all my posts and forums from site A to Site B.

I managed to recreate the table structure in Site B by importing the backup made within Site A's SMF admin section into Site B using phpMyAdmin.

Hoever I still have to get all the posts (all data) across from A to B too.
Otsikko: Re: Upload Backup?
Kirjoitti: Aleksi "Lex" Kilpinen - toukokuu 03, 2011, 01:47:25 AP
Two things you should note -

1) The DB backup will try to create tables that already exist, so it will not work unless you drop the existing tables first.
( That's the "#1050 - Table 'smf_attachments' already exists " error )

2) By simply uploading an older version of a DB to a new version of SMF might not work correctly, and you should make sure to upgrade it after you have it uploaded. ( Get the upgrade.php and all *.sql files from the latest upgrade package, upload them to your SMF installations root, and run upgrade.php )