Announcement

#1 2022-06-03 03:29:15

Doombear
Member
2022-06-02
7

Site Migration - new

Hello/Hi/Greetings,

I inherited a Piwigo site and am trying to move it over to a new host.
The previous Webmaster did a backup of the entire old site's Piwigo website folder and provided an export of their SQL Database.

I made a new SQL database for Piwigo on the new hosting site and tried an Import of the SQL database to the new site through PHPMyAdmin, but it kept timing out. So I got my hosting support people to Import the SQL database on their end.

I edited the database.inc.php with the new Piwigo site login info.

The old galleries did not appear.
The old site has all the pictures in the /upload folder, because that's  how they the images were originally transferred to the site. There wasn't anything in the /galleries folder on the old site.

I tried Synching a few of the old folders, but the old site was too large, so I had to sync only a few at a time. But the metadata, picture order, folder info, picture titles was all empty.

I am the Webmaster of the new Piwigo site, but not the old. The former webmaster isn't part of the new site and no longer wished to host it. I wonder if the old webmaster credentials are required to be registered on the new hosted site to read the database properly?



Environment:
    Piwigo 12.2.0
    Operating system: Linux
    PHP: 7.0.33 (Show info) [2022-06-03 03:11:06]
    MySQL: 5.7.27 [2022-06-03 01:11:06]
    Graphics Library: External ImageMagick 6.9.10-68
    Cache size N/A   never calculated Refresh

Piwigo URL: http://www.moviesgallery.site/

Offline

 

#2 2022-06-03 09:05:56

Katryne
Member
2016-12-03
179

Re: Site Migration - new

I remember that when I import a backup file of a sql from elsewhere, I must change the name of the data base within the backup file, in order to replace it with the name of the new data base, the one at the  new host. 2 or 3 occurences, I think.


https://photos.revestou.fr/  v.12.2 - https://dardennes.revestou.fr/ v.11.5 - http://photos.katrynou.fr/ v.11.5 https://album.chauvigne.info/ v.12.2
Système d'exploitation: Linux - Hébergeur 1&1-Ionos PHP: 7.4.29 - MySQL: 5.7.38
Bibliothèque graphique: External ImageMagick 6.9.10-23

Offline

 

#3 2022-06-03 17:00:11

Doombear
Member
2022-06-02
7

Re: Site Migration - new

That makes sense. I wonder what needs editing - is the new site paths or the webmaster credentials?
Can SQLs files edited with a text editor or do they need a database editor?

Offline

 

#4 2022-06-03 17:51:29

Katryne
Member
2016-12-03
179

Re: Site Migration - new

I use Notepad++.
What is to be changed is the name of the data base. You find the new one in /local/config/database.inc.php  : $conf['db_base'] = 'XXX';

This is the name you will insert as replacement in the sql file of the old site, before importing this modified sql file.

In the sql file, I found the name of the database 3 time, between lines 22 and 25 :

Code:

-- Base de données : `dbsXXX`
--
CREATE DATABASE IF NOT EXISTS `dbsXXX` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `dbsXXX`;

https://photos.revestou.fr/  v.12.2 - https://dardennes.revestou.fr/ v.11.5 - http://photos.katrynou.fr/ v.11.5 https://album.chauvigne.info/ v.12.2
Système d'exploitation: Linux - Hébergeur 1&1-Ionos PHP: 7.4.29 - MySQL: 5.7.38
Bibliothèque graphique: External ImageMagick 6.9.10-23

Offline

 

#5 2022-06-03 19:58:13

Doombear
Member
2022-06-02
7

Re: Site Migration - new

Cool thanks. I found the database in one place on my SQL export file.
It's huge so I can't Import it to the host from my connection, so I've put in a request for them to import it on the server side. It's a large collection with 226,062 Images and a SQL file size of 183Mb.
I'll let you know if it works.

Offline

 

#6 2022-06-03 22:18:33

jnashpiwigo
Piwigo Team
2014-10-21
250

Re: Site Migration - new

You should ensure they provide you with the following:

1) Database Name
2) Database Username  (with full user permissions on database - read/write/create)
3) Database Password
4) Database location (IP/Port/Servername/etc.)

Then, these should all match in your database config file.

More than likely, this is where things are going wrong - not saying definitively, but, most likely.

If these are correct, you shouldn't need to modify the sql dump for import (assuming the import is successful)

Offline

 

#7 2022-06-04 00:05:09

Doombear
Member
2022-06-02
7

Re: Site Migration - new

Yeah, I believe their site hosting shut down June 1st.
I think deleted from their server. I'm only left with the files and the SQL database export.

Offline

 

#8 2022-06-04 01:38:26

jnashpiwigo
Piwigo Team
2014-10-21
250

Re: Site Migration - new

I meant to get that info from your 'new' provider once they import.  They should be providing you this.

Offline

 

#9 2022-06-04 03:18:01

Doombear
Member
2022-06-02
7

Re: Site Migration - new

Hi. Thanks for the suggestions. Yeah, I believe I have gathered all that info from the new provider.
The journey down the rabbit hole continues!

They managed to import the old SQL Database over the new Piwigo install and am now getting these errors when trying to load the site:


Warning: [mysql error 1146] Table 'moviegallery_piwigo.db_config' doesn't exist

SELECT param, value
FROM db_config

; in /home/www/moviesgallery.site/include/dblayer/functions_mysqli.inc.php on line 847

Notice: Trying to get property of non-object in /home/www/moviesgallery.site/include/dblayer/functions_mysqli.inc.php on line 201 Fatal error: Uncaught Error: Call to a member function fetch_assoc() on boolean in /home/www/moviesgallery.site/include/dblayer/functions_mysqli.inc.php:211 Stack trace: #0 /home/www/moviesgallery.site/include/functions.inc.php(1348): pwg_db_fetch_assoc(false) #1 /home/www/moviesgallery.site/include/common.inc.php(118): load_conf_from_db() #2 /home/www/moviesgallery.site/index.php(11): include_once('/home/www/movie...') #3 {main} thrown in /home/www/moviesgallery.site/include/dblayer/functions_mysqli.inc.php on line 211

Last edited by Doombear (2022-06-04 07:35:32)

Offline

 

#10 2022-06-04 14:27:30

erAck
Only trying to help
2015-09-06
1395

Re: Site Migration - new

Check what table prefix the database import uses and specify that in local/config/database.inc.php

Code:

$prefixeTable = 'piwigo_';

(replacing piwigo_ with the actual prefix of course).
It looks like there is no prefix defined at all, otherwise the FROM db_config would be FROM prefix_db_config or whatever was defined instead of prefix_.


Running Piwigo at https://erack.net/gallery/

Offline

 

#11 2022-06-04 16:11:08

Doombear
Member
2022-06-02
7

Re: Site Migration - new

OMG! That fixed it!

Thank you erAck and jnashpiwigo!
You saved me months of work having to manually recreate the albums and upload every gallery one by one.



When my host FreeHostia Imported my SQL database, they must've somehow changed it to PIWIGO as a Database Prefix; it was formerly DB1.

I noticed my old Webmaster is still registered in there as Webmaster and I can't find a way to change it.
I was able to login with the credentials they provided, but unable to change their access level. I guess this is to prevent unauthorized site takeovers. Is there a way to set myself as Configuration webmaster?

Last edited by Doombear (2022-06-04 17:06:17)

Offline

 

#12 2022-06-04 21:28:59

erAck
Only trying to help
2015-09-06
1395

Re: Site Migration - new

Status Webmaster is the highest access level Piwigo has for accounts. With "unable to change their access level" I have no idea what you are talking about. If you are able to login with such Webmaster account it should give you all rights over Piwigo.


Running Piwigo at https://erack.net/gallery/

Offline

 

#13 2022-06-05 01:25:42

Doombear
Member
2022-06-02
7

Re: Site Migration - new

Hi erAck

Thanks. I was able to figure it out.

There are apparently two types of Webmaster on Piwigo:
There is Installation/Configuration Webmaster (first user) and  Web Interface Webmaster/Advisor (second user).
More info about the two different types of webmasters from this page:
https://piwigo.org/doc/doku.php?id=user … ser_status


My site's original webmaster is no longer running the site. so I wanted to become the first webmaster on the list. I was able to fix all this on the SQL database on the User Tables, which seems to be working. I changed the ID of the former Webmaster from 1 to 75. I was #4 on the list. I was then showing up as the main webmaster of the site. For extra measure, I re-created their account and assigned them a lower access level, in case they want to revisit the site but not make any drastic changes.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact