Catalog Migration

Post Reply
rdv4rjm
Posts: 95
Joined: 08 May 18 21:29

Catalog Migration

Post by rdv4rjm »

Soon, I'll be migrating my catalog from a Macpro to a HP Dl380.

Is there a tool for such operation?
I answered this question myself after trying different methods.
There might be a better way, but here's how I ended up doing it my way.
Might be helpful anyhow.

1) First I used the Catalog Database Restore tool from within a fresh installed PSU catalog.
I directed it to my latest backup folder and proceeded.
PSU acted as if it uploaded the catalog, but as I scanned through the Tabs, nothing showed: no categories, no people, no location, nothing.
I thought: Well, I need to add assets.

2) This is what I did. I mapped the catalog to folder containing ALL 20k newly copied assets from same catalog. As they were uploaded in the new catalog, the category structure slowly took shape. Once done, a huge portion of categories were missing.
When we first started with PSU, we built our hierarchical structured catalog. As assets were uploaded, more and more category folders held assets. As of today, number of folders are still empty. Therefore, all empty catalog category folders were dropped in the transfer. And it is normal. In PSU, Assets populate the catalog.
This is what is particular with our project: all assets are scanned. Scanned photos are bare of all useful metadata, and each of them will need to be classified in its particular folder. This is why we built the catalog ahead of time, and this is why I kept pushing to transfer the whole catalog, whether or not folders were linked with any assets.
At this point, there was one option left, retype missing folder in migrated catalog.
No ways.


3) I, then pulled out my first trick which got me going when I first installed PSU a year ago.
I had a list of 1000+ names from a database. I wanted these names to automatically prompt when assigning names to assets in the ASSIGN section. Otherwise, all would need to be typed in as we went along, risking that same name might be typed different ways, creating as many keywords as there would have been misspelled names. In record time, the database would have turned into a mess.

So, I launched the internet and found an odd cheap photo, an eye catching one, like a red plane. I dropped it in each an every folder of each category of the catalog. Once done, its metadata contained over 2000 keywords.
I 'Flew" the plane to its new destination. As soon as file was uploaded the whole catalog structure was built identical to the original one.
It took close to an hour to fill the plane but within a minute, all 2000 "passengers" were home safe.
There might be a less crazy way to do it, but can't argue with success.
If someone knows some other way to do this, I will be more than happy to add it to my toolbox.

Note: This whole thing is about Empty categories not being transferred to new catalog. This afternoon I learned something else. When remapping catalog to a new folder, any empty subfolder will not appear in the folder section of PSU. You must VERIFY FOLDER afterwards. Then, Crossed Folder names will appear. Right click on them and choose: Stop ignoring this folder. You will find out that quantity of assets in these folders is 0. Why would you want to map to an empty folder? In our case we use an hierarchical structure on file folders as well as on Category folders, though each hierarchical structure was built from a different scope. PSU folder section may be used as a file explorer, but to do so, folders must be present empty or not.

Hoping these few lines may bring more light than confusion.
Thanks
Last edited by rdv4rjm on 15 May 19 20:19, edited 1 time in total.
snowman1
Posts: 394
Joined: 01 Jan 07 2:13

Re: Catalog Migration

Post by snowman1 »

I think you will have to provide more information for someone to assist you here.
rdv4rjm
Posts: 95
Joined: 08 May 18 21:29

Re: Catalog Migration

Post by rdv4rjm »

Sorry for this.
I edited my post instead.
Hert
Posts: 7870
Joined: 13 Sep 03 6:24

Re: Catalog Migration

Post by Hert »

I believe you're a PSU-Server user? In that case, it's a matter of backing up the databases with the database tools (for Postgresql that is pgAdmin). Then on the new machine, restore the databases.

Once restored, start PSU and after login make sure to relocate the top level root folder to the correct location.
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
rdv4rjm
Posts: 95
Joined: 08 May 18 21:29

Re: Catalog Migration

Post by rdv4rjm »

Thanks Hert!
I want to simulate migrating the catalog.
I am using VMs on which I tested PhotoSupreme.
OS are Windows for server as well as for workstation. A first for me. As of now, server is operating on a Macpro.
With checkpoints on VMs, testing is easy and quick. At any point in time we can make a step back and try same sequence again a different way until goal is reached.

1) On MacPro, I backed up complete catalog using command: pg_dumpall> /postgres_Backup/cluster_backup.sql

2) On VMs running windows, I installed Postgresql 10.8.
Modified both config files as stated in instructions.

3) Installed PSU with which I created new catalog. Named it same name as migrating database.

4) Ran Restore command: psql -U {username} -d {db name} -f cluster_backup.sql

System returned error: cannot find {db name}, (I had put my database name)


5) Went back to step 2. Didn't reinstall PSU.
In Postgres, I created a new catalog same name as the migrating catalog

6) Installed PSU. and tried connecting to existing catalog: Failure see attached file
once operation done, it asked for postgres password again. any password I tried wasn't accepted.

Will keep trying tomorrow.
Attachments
after creating db in psql.jpg
after creating db in psql.jpg (49.8 KiB) Viewed 7312 times
psql 01.jpg
psql 01.jpg (77.87 KiB) Viewed 7312 times
Hert
Posts: 7870
Joined: 13 Sep 03 6:24

Re: Catalog Migration

Post by Hert »

You've backed up the entire database from the old machine and restored it on the new machine. I guess that also changed the password of the Postgresql user to the password from the old machine.

The steps I would do are:
1. Create backup of the photosupreme and photosupreme_thumbs databases using pgAdmin or pg_dump
2. On the new machine, install a new PSU database (creates a new photosupreme and photosupreme_thumbs database)
3. Restore the photosupreme database and photosupreme_thumbs database from the backup files.
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
rdv4rjm
Posts: 95
Joined: 08 May 18 21:29

Re: Catalog Migration

Post by rdv4rjm »

Makes sens.
Since I backed up using dumpall command,
and now restoring to a specific database name, it's as if I am trying to include all postgres databases from source machine to a single database on destination machine.

Backup: $ pg_dump -U {user-name} {source_db} -f {dumpfilename.sql}

Restore: $ psql -U {user-name} -d {desintation_db}-f {dumpfilename.sql}

This should do the job.

My only ?: install a new PSU database
You mean using PSU: create a new catalog.

Then: Restore the photosupreme database and photosupreme_thumbs database from the backup files.
You mean: apply restore command from command line, not restore backup tool in PSU.

Let me know if i'm wrong.
Going at it, in the meantime.
Will keep you posted.
rdv4rjm
Posts: 95
Joined: 08 May 18 21:29

Re: Catalog Migration

Post by rdv4rjm »

This is how I proceeded based on my understanding of proposed method.

1- I backup up database with following command:
pg_dump -U {user-name} {source_db} -f {dumpfilename.sql}
pg_dump -U postgres photosupreme -f photosupreme.sql

I suppose this backed up photosupreme and photosupreme_thumbs database as suggested.

2. On new machine, I install a new PSU database
Set database name: photosupreme

3. Restored photosupreme database using following command
psql -U {user-name} -d {desintation_db}-f {dumpfilename.sql}
psql -U postgres -d photosupreme -f Y:\db_backups\pg_photosupreme_data\photosupreme.sql

The result shows in restoring 01 file
Looked good.
Launched PSU.
was asked postgres superuser password.
Then message in restoring 02 file
Didn't know what to answer: choose yes
Then message in restoring 03 file

Once in PSU, nothing showed as having been updated.
I thought I may need to upload assets.
So I did.
All categories were present. I assume because of assets metadata.

There were missing info in the info pane, in details pane and all mapped info in categories are also missing.
See other attached jpgs.

Will keep experimenting.

( the 2 main message snapshots won't upload??) will try in next post
Attachments
restoring 02.jpg
restoring 02.jpg (30.41 KiB) Viewed 7278 times
restoring 01.jpg
restoring 01.jpg (53.3 KiB) Viewed 7278 times
mapped info.jpg
mapped info.jpg (39.93 KiB) Viewed 7278 times
info pane.jpg
info pane.jpg (33.59 KiB) Viewed 7278 times
Details.jpg
Details.jpg (13.96 KiB) Viewed 7278 times
rdv4rjm
Posts: 95
Joined: 08 May 18 21:29

Re: Catalog Migration

Post by rdv4rjm »

Here they are
Attachments
restoring 04.jpg
restoring 04.jpg (76.69 KiB) Viewed 7278 times
restoring 03.jpg
restoring 03.jpg (41.91 KiB) Viewed 7278 times
rdv4rjm
Posts: 95
Joined: 08 May 18 21:29

Re: Catalog Migration

Post by rdv4rjm »

This was then.
Still is now.
Nothing has improved.
but we now have a new version....
Tried it: no success.

Details? all the above threads. Nothing new.
Hert
Posts: 7870
Joined: 13 Sep 03 6:24

Re: Catalog Migration

Post by Hert »

Your message indicates that you have missing views. Make sure that your backup is complete.

Did you follow my instructions from above? I've done that tons of times with pgAdmin. Create a backup with pgAdmin using the standard settings. On restore, make sure to configure pgAdmin to empty tables. keep the other restore settings at default.
The steps I would do are:
1. Create backup of the photosupreme and photosupreme_thumbs databases using pgAdmin or pg_dump
2. On the new machine, install a new PSU database (creates a new photosupreme and photosupreme_thumbs database)
3. Restore the photosupreme database and photosupreme_thumbs database from the backup files
Step 2 is very important as that sets the database rights, don’t skip.
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
Post Reply