MyBB Community Forums

Full Version: Using an old backup [1.8.3] mysqli
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Guys,

I used to have a forum using 1.8.3 on a mysqli database.
This forum was hosted on domain.com
I no longer have this domain, so it's on website.com/domain for example.
I have dome some crazy database backup editing to get old backups of other forums to work on new domains.
I just make a new database in phpmyadmin, edit the database backup file, then change inc/config.php to point to the new database.

I believe the following to be relevant lines of the SQL backup.

INSERT INTO mybb_settings (`sid`,`name`,`title`,`description`,`optionscode`,`value`,`disporder`,`gid`,`isdefault`) VALUES ('4','bburl','Board URL','The url to your forums.<br />Include the http://. Do NOT include a trailing slash.','text','http://website.com/domain','2','2','1');
INSERT INTO mybb_settings (`sid`,`name`,`title`,`description`,`optionscode`,`value`,`disporder`,`gid`,`isdefault`) VALUES ('5','homename','Homepage Name','The name of your homepage. This will appear in the footer with a link to it.','text','my forum','3','2','1');
INSERT INTO mybb_settings (`sid`,`name`,`title`,`description`,`optionscode`,`value`,`disporder`,`gid`,`isdefault`) VALUES ('6','homeurl','Homepage URL','The full URL of your homepage. This will be linked to in the footer along with its name.','text','http://website.com/domain','4','2','1');
INSERT INTO mybb_settings (`sid`,`name`,`title`,`description`,`optionscode`,`value`,`disporder`,`gid`,`isdefault`) VALUES ('10','cookiedomain','Cookie Domain','The domain which cookies should be set to. This can remain blank. It should also start with a . so it covers all subdomains.','text','.website.com','8','2','1');
INSERT INTO mybb_settings (`sid`,`name`,`title`,`description`,`optionscode`,`value`,`disporder`,`gid`,`isdefault`) VALUES ('11','cookiepath','Cookie Path','The path which cookies are set to. We recommend setting this to the full directory path to your forums with a trailing slash.','text','/domain/','9','2','1');
INSERT INTO mybb_settings (`sid`,`name`,`title`,`description`,`optionscode`,`value`,`disporder`,`gid`,`isdefault`) VALUES ('12','cookieprefix','Cookie Prefix','A prefix to append to all cookies set by MyBB. This is useful if you wish to install multiple copies of MyBB on the one domain or have other software installed which conflicts with the names of the cookies in MyBB. If not specified, no prefix will be used.','text','','10','2','1');

Same code, might be easier to read.

('4','bburl','Board URL','The url to your forums.<br />Include the http://. Do NOT include a trailing slash.','text','http://website.com/domain','2','2','1');
('5','homename','Homepage Name','The name of your homepage. This will appear in the footer with a link to it.','text','my forum','3','2','1');
('6','homeurl','Homepage URL','The full URL of your homepage. This will be linked to in the footer along with its name.','text','http://website.com/domain','4','2','1');
('10','cookiedomain','Cookie Domain','The domain which cookies should be set to. This can remain blank. It should also start with a . so it covers all subdomains.','text','.website.com','8','2','1');
('11','cookiepath','Cookie Path','The path which cookies are set to. We recommend setting this to the full directory path to your forums with a trailing slash.','text','/domain/','9','2','1');
('12','cookieprefix','Cookie Prefix','A prefix to append to all cookies set by MyBB. This is useful if you wish to install multiple copies of MyBB on the one do...','text','','10','2','1');

The issue is that when I head to website.com/domain all/most of the buttons point to the original domain and when i go to website.com/domain/admin I can login, view the initial info (which is accurate) but clicking on any link does a weird redirect to login prompt, but with accurate URL...
I have a feeling it's something I'm not seeing with the cookie settings, but I don't know.

Edit
Quick update, I think the board URL is set correctly, just when writing the header I used the full URL instead of the bburl variable. There are some things I can visit, but the style sheet and everything are broken... they're trying to use the old URL for some reason.. Still assume cookies are broken.
you can edit ~/inc/settings.php file to put changed domain, cookie settings .. etc.

after putting correct domain & cookies in settings.php file ,
you should be able to login to forum admin panel. then those settings should be again
set correct
at the Site Details page of Configuration section in forum admin panel.
That did the trick! Thanks heaps M.