Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

Can't import database from 2.1 [RESOLVED]

sudden156sudden156 ✭✭
edited October 2017 in Vanilla 2.3 Help

I get an error when trying to import the database from my old 2.1 site to 2.3.

It says:

1050 - Table 'GDN_Activity' already exists

The specific error says:


--

-- Table structure for table GDN_Activity

CREATE TABLE GDN_Activity (
ActivityID int(11) NOT NULL,
CommentActivityID int(11) DEFAULT NULL,
ActivityTypeID int(11) NOT NULL,
NotifyUserID int(11) NOT NULL DEFAULT '0',
ActivityUserID int(11) DEFAULT NULL,
RegardingUserID int(11) DEFAULT NULL,
Photo varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
HeadlineFormat varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
Story text COLLATE utf8_unicode_ci,
Format varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
Route varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
RecordType varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
RecordID int(11) DEFAULT NULL,
CountComments int(11) NOT NULL DEFAULT '0',
InsertUserID int(11) DEFAULT NULL,
DateInserted datetime NOT NULL,
InsertIPAddress varchar(39) COLLATE utf8_unicode_ci DEFAULT NULL,
DateUpdated datetime DEF[...]


I'm afraid I know very little about databases, flying by the skin of my teeth. Any idea what I can do to import my old database successfully?

Comments

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    I assume you are trying to use the porter plugin? If so, you shouldn't be, and it is why you are having issues.

    To upgrade to Vanilla 2.3 simply follow the steps in the readme, and then run utility/update.

    See this discussion: https://open.vanillaforums.com/discussion/comment/249843/#Comment_249843

  • I'm importing using phpMyAdmin, also exported using it.

  • sudden156sudden156 ✭✭
    edited October 2017

    I created a fresh install of Vanilla 2.3. Then dropped all the tables and tried to import the old database.

  • I have also tried it on another fresh install without dropping all the tables first and get the same error.

    Obviously I am just trying things that have somehow worked in the past. But I'm afraid I quite lack the knowledge of databases to make any kind of adequate assessment of what I'm doing wrong or what I need to do to get it right. This is why I tend not to update! More luck than skill in my case. Out of luck this time perhaps.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator
    edited October 2017

    Have you moved servers?

    If not, you don't need to do much at all to the DB. If yes, see the 2nd half of this answer.

    Not moved server

    You simply upload the Vanilla 2.3 files to overwrite your current installation, with the addition, for 2.1 of this

    To upgrade from 2.1 or earlier:

    Update any locales you have installed (their name format changed in 2.2). Verify they are working after upgrade.
    Apache users must update their .htaccess file.
    Delete these files from your server if they exist: /themes/mobile/views/discussions/helper_functions.php and /applications/dashboard/views/default.master.php

    https://github.com/vanilla/vanilla/blob/master/README.md

    Some people have run into issues with the htaccess file for 2.3, and have swapped it out for the version from Vanilla 2.2. If necessary, you can simply download a copy of Vanilla 2.2, unzip it, and upload the htaccess file.

    Then run utility/update and you should be good to go.

    Moved server

    If you have moved servers you will need access to your old DB.

    I would suggest you

    a) install a clean copy of Vanilla 2.1 in your new server.

    Copy over your Vanilla files from the old server.

    Move your old DB to your new server.

    Make sure the conf/config.php file has the correct DB credentials

    Delete any ini files from cache folder

    Once you have a working Vanilla 2.1 forum, simply follow the upgrade steps.

    sudden156
  • sudden156sudden156 ✭✭
    edited October 2017

    Ah, that's interesting, thanks.

    I haven't moved servers yet, but will have to soon. Was just practising prior to move on my current host.

    Where can I get a copy of Vanilla 2.1? I only usually install via Softaculous. I didn't realise older versions were available somewhere.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator
    edited October 2017

    If you go to the core download page, older versions are listed on the right.

    https://open.vanillaforums.com/addon/vanilla-core

    Where possible, it is better to avoid using 3rd party installers.

    zulash
  • Great, thanks.

    One other point, when you say 'Move your old DB to your new server' I take it you don't mean importing it via phpMyAdmin. What is the best way to move the DB over?

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    You can use phpMyAdmin for this, depending on the size of your DB, otherwise you can use mySQL command line to do the job.

    To check, export your DB, and then try to import it into phpMyAdmin.

    If it works, you're good.

  • To finish this story off with a happy ending, I finally solved it by somehow managing to export my DB such that it imported fine into both a 2.1 installation and 2.3. I don't regret all the hair-pulling, though, as I learnt a whole lot more about what I'm attempting to do and am much more confident to tackle it now after the big practice run. And very useful to learn how to install Vanilla myself too, rather than via Softaculous. Thanks for your help.

    R_J
  • Hi, congratulations.

    I moved my site to a new server but I need to redo the move of my vanilla messages from the old server to a new one. Support at the hosting company did it the first time they are not responding to my requests to do it again. Any instructions for how to identify and move the file from one server to another?

    Can you tell me what the data file is called? Can I just copy the file and upload it to the new server?

    Many thanks

  • You mean the private messages as opposed to the discussions?

    I don't know anything about moving one part of a database, only the entire database that contains everything.

    Go to phpMyAdmin from cPanel and export your database from your old server and save it. Then find your new database in phpMyAdmin on your new server and under 'Structure' check them all via the check-all box at the bottom then 'drop' all the tables. Now import your old database.

    I know nothing about this really, just found that doing that works.

    My mistake appears to have been exporting 'localhost.sql.zip' rather than 'name_of_my_database.sql.zip'.

Sign In or Register to comment.