1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Restoring an older forum

Discussion in 'Troubleshooting and Problems' started by Devilwillcry4you, Dec 24, 2013.

  1. Devilwillcry4you

    Devilwillcry4you Active Member

    I wanted to ask a quick question, I am trying to restore a forum and when I import the sql file I get the error message "An unexpected database error occurred. Please try again later." I know that the DB username and password are most likely different, how or what can I edit to add the new ones?
     
  2. Sheratan

    Sheratan Well-Known Member

    Did you restore the forum to the same server before?

    If no, I would advise you to check the database previlege. You can add or edit database username and password there.

    FYI: The "fast but unsafe" band aid for this is using mysql root password to connect to your database.
     
  3. Devilwillcry4you

    Devilwillcry4you Active Member

    Yes it's on the same server, I was just thinking that before it was on the root and now it's in a sub directory. I found the config.php where I can change the DB info, not sure if that would work.
     
  4. Sheratan

    Sheratan Well-Known Member

    If you are using cpanel, you can try to add a new mysql user with a new password in cpanel > mysql database and then assign them to your xf database. Then edit your /library/config.php and edit the database user and database password.

    You can do the same thing in VPS/Dedicated with phpmyadmin (if you are using phpmyadmin)
     
  5. Devilwillcry4you

    Devilwillcry4you Active Member

    I just did the new user and the config file and still not connecting.
     
  6. Sheratan

    Sheratan Well-Known Member

    How about database user privilege?
     
  7. Devilwillcry4you

    Devilwillcry4you Active Member

    Where can I check them at, sorry drawing a blank lol
     
  8. Devilwillcry4you

    Devilwillcry4you Active Member

    I think it's not working because the forum is set to the root and and I have it in a sub directory. So it can't connect without being in the root.
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    The location of the installation makes no difference.

    The details in /library/config.php must match the database details.
    The Board URL in the ACP can be updated to suit once the import is complete.
     
  10. Sheratan

    Sheratan Well-Known Member

    If you are using cpanel: cpanel > mysql database

    Or in phpmyadmin: *select database* > Privilage
     
  11. Devilwillcry4you

    Devilwillcry4you Active Member

    Thank you I get it to connect to the DB. Now have to figure out why admin user and pass not working lol
     
  12. Tracy Perry

    Tracy Perry Well-Known Member

    Did you (as earlier recommended) grant that user the appropriate rights to the DB?
    If you are on a VPS I have found it's easier to just SSH in and do it from the command line.
     
    Devilwillcry4you likes this.
  13. Devilwillcry4you

    Devilwillcry4you Active Member

    I got everything working great, thank you all.
     

Share This Page