Restore .sql backup and html directory.

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
mecallie
Registered User
Posts: 3
Joined: Sat Feb 08, 2025 4:32 pm

Restore .sql backup and html directory.

Post by mecallie »

Hello folks,

I volunteered to take over an old forum that was no longer being maintained. The owner give me the html directory and an .sql backup file of the entire database.

I have installed phpbb on Yunohost and was hoping that I could restore the .sql from within the web interface. But that doesn't seem to be the case.
So my questions are:
1. Can I restore the .sql file in to the current database with something like phpmyadmin?
2. Do I need to update the older html files as well? What will I be missing if I do not import the html directory (note: that's probably of an older version of the forum software, no idea how old).
3. Is there some other way for me to import all the users/settings and if possible posted images/attachments from the backup that I have?

I am very new to phpbb (and to sql too), but hopefully I can get this working for all the people who are missing their forum!
User avatar
Mike-on-Tour
Registered User
Posts: 571
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael

Re: Restore .sql backup and html directory.

Post by Mike-on-Tour »

You can import the .sql file with phpMyAdmin, but you must change the entries in the config.php file.
What directories/files you need to store on the server are the config.php file and the ext, files, images and store directories and then download the latest version, unzip it and upload all other than the mentioned file/directory, IF the version of the old board is greater than 3.1.x, OTHERWISE it would be a good idea to upload all files and directories, get the STK and clean the database.

The most important question now is on what version the old board ran.
Watz fo lunch?
If you like my extensions or my support please consider a donation: Image
User avatar
warmweer
Jr. Extension Validator
Posts: 12180
Joined: Fri Jul 04, 2003 6:34 am
Location: somewhere in the space-time continuum

Re: Restore .sql backup and html directory.

Post by warmweer »

mecallie wrote: Sat Feb 08, 2025 4:46 pm 1. Can I restore the .sql file in to the current database with something like phpmyadmin?
Yes .. but why into the current database? If you do that, then you'll lose an example of a functional database (a new one can be made of course but since you've got one just keep it as a reference for the time being).
mecallie wrote: Sat Feb 08, 2025 4:46 pm 2. Do I need to update the older html files as well? What will I be missing if I do not import the html directory (note: that's probably of an older version of the forum software, no idea how old).
If you're referring to the old html-files from the backup ... then yes in order to have a functional up to date board, then files and database version should be the same so you''ll have to download the files version you're updating or upgrading to.

What the version in /styles/prosilver/style.cfg ?

Also in the database backup you imported: look in the config_table, field version ... also post that here.
mecallie wrote: Sat Feb 08, 2025 4:46 pm 3. Is there some other way for me to import all the users/settings and if possible posted images/attachments from the backup that I have?
Those images/attachments are in the files backups. The database contains data referring to those images/attachments (and other data e.g. user_data, forums, topics, posts, etc...

I suspect your thinking about creating an up-to date phpBB board and then importing the data from the old board.
That's the difficult way and could easily fail since the database may contain data incompatible with 3.3.14.
As mentioned by Mike-on-Tour. Use the database backup to get a board up and running, then sanitise it using the STK and the Upgrade.

Start by mentioning the database version (in the .sql) and the PHP version(s) you host provides.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
mecallie
Registered User
Posts: 3
Joined: Sat Feb 08, 2025 4:32 pm

Re: Restore .sql backup and html directory.

Post by mecallie »

Thank you for your replies, sounds hopeful
I am trying to restore the DB/files on a Yunohost instance, and that installs the latest version by default.

Sanetise it using the STK: what is an STK?
Prosilver states the version is 3.3.5 << That doesn't sound to bad?!
PHP on the new server is 8.3
.sql file states: MariaDB dump 10.19 Distrib 10.11.8-MariaDB, for Linux (x86_64)
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6696
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Restore .sql backup and html directory.

Post by thecoalman »

If it's 3.3.X don;t worry about STK. A MariaDB export is MySQL compatible.

Long directions for transferring board to new domain:

Transferring Your Board to a New Host or Domain

The short version:

Populate the database using phpMyadin or SSH, the how is dependent on your host. Consult their documentation

Upload the files. Open config.php in phpBB root and change the DB credentials.

Should be working. If you are getting errors try this SQL first, otherwise post the errors/issue here.

Code: Select all

UPDATE `phpbb_config` SET `config_value` = '0' WHERE `phpbb_config`.`config_name` = 'force_server_vars'; 

Once everything is working directions can be found here for updating to latest: https://www.phpbb.com/support/docs/en/3 ... date_full/


If you don't have founder account you can use this to change it:

In phpMyAdmin, run the following, which will create an admin user named Admin1 with a password of admin. From that point you should be able to get into the ACP.

Code: Select all

INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_jabber, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin1', 'admin1', 0, '21232f297a57a5a743894a0e4a801fc3', '[email protected]', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '');
Change your table prefix if it is not phpbb_

See Executing SQL Queries in phpMyAdmin if you are unfamiliar with running database queries.

As soon as you have done this, use the temporary admin account to change the details on the original admin account, then delete the temporary account.
This is because:
  1. anyone could use that account to log in to your board if you didn't change the password.
  2. this temporary user has not been fully set up (e.g. it is not a member of the "Registered users" group, so it won't have normal access to your forums).
To remove the account you will first need to remove ???founder??? status from it: ACP > USERS AND GROUPS tab > Manage Users > Admin1 > Overview > Founder = No


Run this SQL to find and remove founders set by previous owner, this should only return results for your account. Remove the others by looking the user up in phBB's ACP, on main page for the user lookup is selection to set/unset as founder.

Code: Select all

SELECT * FROM `phpbb_users` WHERE `user_type` = 3 
Founders are super admins and have complete access to ACP regardless of any other permissions.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
mecallie
Registered User
Posts: 3
Joined: Sat Feb 08, 2025 4:32 pm

Re: Restore .sql backup and html directory.

Post by mecallie »

Thank you for the quick replies. I went through the documentation for backup/restore.

The thing I cannot find: do I need to change the prefix to phpbb? The prefix in my "old" db seems to be phpbb3 .
I am also wondering if I run in to issues later on, since it is managed by Yunohost: no idea how that will handle an upgrade after I change the database users/passwords/prefix...

I have a backup of the current (empty) database. Is it not possible just to fill that db (after dropping the tabples?) with the old backup? No idea how I can change the prefix whist doing that though.
User avatar
warmweer
Jr. Extension Validator
Posts: 12180
Joined: Fri Jul 04, 2003 6:34 am
Location: somewhere in the space-time continuum

Re: Restore .sql backup and html directory.

Post by warmweer »

mecallie wrote: Sun Feb 09, 2025 11:07 am The thing I cannot find: do I need to change the prefix to phpbb? The prefix in my "old" db seems to be phpbb3 .
The prefix of the tables isn't important as such, in the config.php the prefix is or will be defined.

In theory you could run different phpBB boards from 1 database (using different table_prefixes).
mecallie wrote: Sun Feb 09, 2025 11:07 am I have a backup of the current (empty) database. Is it not possible just to fill that db (after dropping the tabples?) with the old backup? No idea how I can change the prefix whist doing that though.
Just import the backup as/is. In your config_php you can edit the prefix which defines the tables to be read by phpBB.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.

Return to “[3.3.x] Support Forum”