How to install XenForo locally to your PC using XAMPP

How to install XenForo locally to your PC using XAMPP

Mr. Wah

Member
Is there a guide for connecting the created localhost instance to say Eclipse PDT? I attempted to hook mine up to the existing project and sadly I can't seem to get it to breakpoint or debug when running pages :(
 

tourmeister

Active member
So I have everything installed and working for XAMPP.

I had XF 2.012 installed and working with an essentially empty database.

I did a mysqldump of the live database and downloaded it to to my local machine.

I went into phpMyAdmin and deleted the database used when installing XF from scratch. I then created an empty database with the same name, same username, and same password.

I imported the backup into the empty database using command line via the shell in XAMPP.

Scott@SCOTT-PC c:\xampp
# cd c:\xampp\mysql\backup\twtexco

Scott@SCOTT-PC c:\xampp\mysql\backup\twtexco
# mysql -p -u twtexco_xf2 twtexco_xf2 < twtexco_xf2.sql
Enter password: **************


That seems to have worked. However, now I no longer access the site via


I just get this,

An unexpected error occurred. Please try again later.

I suspect this has something to do with Setup Options that are saved in the backup of the live database for things like the Board URL, etc,...?

If so, how to do fix it?
 

andybond

Well-known member
Disable all the plugins / addons with this in the config.php

$config['enableListeners'] = 0;


Then try to reenter your boards.

Change the settings , then remove that line ..
 

tourmeister

Active member
Disable all the plugins / addons with this in the config.php

$config['enableListeners'] = 0;


Then try to reenter your boards.

Change the settings , then remove that line ..
Okay, that got me into the Admin CP.

I went to the Basic Board info and changed the http://www.twtex.com/forums to http://localhost/forums and saved it.

I get this when I try to go to the forum via http://localhost/forums/index.php
194515

If I remove that line from the config.php file, it goes back to keeping me out of the Admin CP.
 

tourmeister

Active member
Grrr...

I forgot to uncheck the canonicalization box. :rolleyes:

Did that, saved, and reloaded.

So I can get to the main forum page, but there are NO nodes displaying at all. I can click on new posts and it pulls up a list of threads. I can click on a node name under the thread name and go to any node I want, but if I click on "Forums", I just get a blank page.

194516
 

tourmeister

Active member
Okay, so I nuked the database and install of XF.

I created a new database with the same name and credentials as my live site.

I installed a fresh copy of XF2.0 and then upgraded that to 2.012. I then installed all of the same add-ons that my live site has (no template edits, just the plug and play add-ons).

That was all working great. So I zipped the htdocs directory and I did a mysqldump of the clean database, just to save time if I have to start over again...

I have a recent copy of a backup from my live site's database.

My next step is to delete the current database on my local machine, create a new empty database with the same name and credentials, then import the backup of the live site database.

After doing this, the board information in the database will be wrong but the info in the config.php should still be correct because that is what I was using to do the install, upgrade, and installation of the add-ons.

So should I be able to get into the Admin CP to edit the board info, or do I still need to edit the config.php and add,

$config['enableListeners'] = 0;

I just want to make sure I have the steps right.
 

tourmeister

Active member
One other question. Do I need to do anything regarding SSL issues on the local host? All the links in the database use https. Will that still work in XAMPP?
 

tourmeister

Active member
Well, it works.

I did not have to edit the config.php

After I imported the live database into the localhost database, I was able to log in to the Admin CP, change the Board information, and then open the Forum page. All the nodes display properly. All the links seem to be working.

No idea what went wrong the first time around... :rolleyes:

I do appreciate your patience and help though. I don't do this stuff for a living and I spend a LOT of time beating my head against my keyboard... But I am trying to learn it as fast as I can.
 

Brogan

XenForo moderator
Staff member
Live to localhost is the same as localhost to live.
It's just copying the installation from one server to another.
 

ShikiSuen

Member
Maybe a stupid question @Brogan , but is there a guide for taking my localhost site/database and putting it onto my live site?
1. Pack your wwwroot folder as a tgz package (or maybe 7z if you have 7z installed on your server).
2. Use mysql command to dump your forum database (with all forum tables inside) into an SQL file.
3. SFTP / FTP upload them to your server.
4. Configure MySQL 5.7 / 8.x (or any Xf-compatible MySQL distro) and Nginx.
5. Unpack your tgz package to /inetpub/wwwroot/ contents (the site folder defined in your Nginx).
6. run the following in your zsh / bash and then enter your root password:
Code:
mysql -u root -p < "SQL File Directory"
7. Use NE / NANO / VIM to edit /inetpub/wwwroot/src/config.php to config your MySQL account access information.
8. Start your Nginx service.

(I prefer to use /inetpub/wwwroot on my Ubuntu server.)
 
Top