Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: CyberShadow on February 12, 2020, 05:01:12 AM

Title: Restoring a Backup
Post by: CyberShadow on February 12, 2020, 05:01:12 AM
I recently upgraded my server, so I made a backup of the data, FTP'd the entire site to a local machine, upgraded the server, reinstalled 2.0.17, uploaded the database dump and added back the theme.

The only problem is that the boards look fine - the theme has worked - and the database appears to have the correct data in it, but the actual boards still show only the default single board and message. The various categories, boards and messages are in the database but the front end is stuck with the fresh install messages and structure.

Did I forget to change a file to writable somewhere? Any idea what has happened and - more importantly - how to fix it?
Many thanks.
Title: Re: Restoring a Backup
Post by: Illori on February 12, 2020, 05:05:15 AM
did you restore your backup to the same database that is being used by the install? it sounds like you have not.
Title: Re: Restoring a Backup
Post by: CyberShadow on February 12, 2020, 05:40:58 AM
I only have the one database on that site.
Title: Re: Restoring a Backup
Post by: CyberShadow on February 12, 2020, 05:56:55 AM
Well.... This is embarrassing......  ;D

So, I DO only have the one database for the site. When I made the backup, I went through phpMyAdmin.
When I restored it, I tried to do this through Plesk, and it clearly didnt work even though Plesk said that it did.

So.... Now I tried importing through phpMyAdmin I get the following error:
#1046 - No database selected

When I try to import through Plesk, I get a different error:
ERROR 1062 (23000) at line 43: Duplicate entry '1' for key 'PRIMARY'
program 'mysql' finished with non-zero exit code: 1

I realise that its my account causing the problem in the second case.
Any suggestions to solve this?

Many thanks.

EDIT - I am going to try a fresh install, and use the same prefix as the backup, then remove the entire database and create a new one to house the backup......
Title: Re: Restoring a Backup
Post by: CyberShadow on February 12, 2020, 06:52:39 AM
UPDATE - I removed the previous install, and reinstalled the forum fresh, using the same table prefix as the backup, then removed the database, created a blank one and reinstated the database backup.

Partial success. The database appears to have accepted the backup data and the topics, boards and threads are all present. However, it has now messed with the theme, and I am just getting the white page with no format links and text. So reinstating the backup messed with the link to the theme directory?
Title: Re: Restoring a Backup
Post by: Gary on February 12, 2020, 07:18:17 AM
It sounds like your paths to directories haven't been reset, run repair_settings.php from the download page to do that.
Title: Re: Restoring a Backup
Post by: Illori on February 12, 2020, 07:20:57 AM
What is repair_settings.php? (https://wiki.simplemachines.org/smf/Repair_settings.php)
Title: Re: Restoring a Backup
Post by: CyberShadow on February 12, 2020, 08:02:12 AM
Thank you both so much. It showed me where the problem was so I could fix it. I had nerfed the subdomain and the paths were all messed up.

I appreciate your assistance and time. Thanks.
Title: Re: Restoring a Backup
Post by: CyberShadow on February 13, 2020, 02:33:23 AM
While the boards now appear to be working, there is an issue. Every time I attempt to post or edit a post, I initially get a '403 no permission' error, and then the boards crash (and take down my email with them). I assume that I have not set a write permission correctly, but I can post, it just takes a few attempts and it crashes more often than it works.

This would appear to be a database issue, as the rest of the static site is fine and it affects email too, but the permissions for the database were fine when the boards were in maintenance mode and I wasn't posting to them.

Thanks.
Title: Re: Restoring a Backup
Post by: m4z on February 13, 2020, 04:54:22 AM
What do you mean by "my email", a webmailer software living on the same server?
Title: Re: Restoring a Backup
Post by: CyberShadow on February 14, 2020, 12:41:50 AM
I am running a VPS across several domains. One domain has the SMF software, a second has my email account. I just tried again. My boards are offline, but I tried to edit a post that I made yesterday. First attempt resulted in a 403 no permission error. Then I tried to preview, got the same response. Tried to edit again, and the server timed out. Attempted to refresh my email and the server timed out there too.

So, it seems that I cant edit a post, and if I try it just overloads the server (including other sites and my email).

Thanks.
Title: Re: Restoring a Backup
Post by: Kindred on February 14, 2020, 12:43:40 PM
sounds like some bad configurations of the server
Title: Re: Restoring a Backup
Post by: CyberShadow on February 19, 2020, 08:49:13 AM
I removed the database user, used repair_settings to check the database password and set up the database user again to verify the correct connections.....

This seems to have solved the access issue and I can now post and edit posts fine... no 403 errors so far, anyway. However, the formatting of a post is messed up. I wrote this with the correct new lines and spacing, but this is how it is displayed (see attachment). When I edit the post, it displays in the editor also badly formatted, and when I correct it, it doesn't change up update.
Title: Re: Restoring a Backup
Post by: Kindred on February 19, 2020, 09:11:43 AM
are you using the wysiwyg?  If so, don't...  the 2.0 wysiwyg is so broken that we completely removed and replaced it in 2.1 since it was more work to fix it than to replace it.
Title: Re: Restoring a Backup
Post by: CyberShadow on February 20, 2020, 04:16:15 AM
are you using the wysiwyg?  If so, don't...  the 2.0 wysiwyg is so broken that we completely removed and replaced it in 2.1 since it was more work to fix it than to replace it.

Fantastic! That solved it.
Many thanks to all in this thread who helped me out.