Data Migration: not importing Google Photos

Hello,
I am trying to setup google photo/cloud migration using the Google integration app
I have gone through all the hoops on the google APIs & Services page, created the oauth keys and added those as nextcloud admin. Then as I user I connected my google account and that appears to, it shows:

  • All my calendars
  • “~1183 Google photos (~1 GiB)”
  • “400 files in Google Drive (3 GiB)”

But then when I click import a notification shows that import has started but for a couple of days now there is no progress whatsoever:

0 photos imported
Photo import background process will begin soon. You can close this page. You will be notified when it finishes.

What should be a starting point for analysis? Because there is nothing in the nextcloud log about this.

1 Like

After looking at this issue for days I suddenly had a brainwave: what if something is wrong with the background jobs? And indeed: My cron job had not run for 7 days, switched to system cron: now it is importing photos.

1 Like

Dries,

I guess i want to achieve the same solution; is there a tutorial of this setup available?? Or could you explain how/what you did to achieve this??

Thanks in advance,
Fijne kerst!

Dennis

Hoi Dennis,

Sorry for this late response (but you know: Christmas and all :slight_smile: ).

After this announcement I thought there would be a clear description on how to do this, but I could not find it (not sure if it does exist at all). Maybe someone else knows of a step-by-step how-to?

But basically I first installed the Google integration module after installation a new item exists in the Administration Settings: “Connected Accounts” that has one item: Google Integration, it has a short summary of what to do:

If you want to allow your Nextcloud users to authenticate to Google, create an OAuth application in your Google settings. Google API settings
Go to “APIs & Services” => “Credentials” and click on “+ CREATE CREDENTIALS” → “OAuth client ID”.
Set the “Application type” to “Web application” and give a name to the application.

Make sure you set one “Authorized redirect URI” to https://-----/index.php/apps/integration_google/oauth-redirect

Put the “Client ID” and “Client secret” below.

I kind of “stumbled” my way through the Google API settings (had to enable the Photo API, Drive API etc.) taking queues from the error messages at connection. The app that I registered on the google api pages is not trusted which means that I had to add the all the google accounts of all nextcloud users that want to use the integration.

Hope this helps at least a bit.

Cheers,

Dries

1 Like

Hi to all,

I have the same problem.
Photos and datas are not imported, but contacts and calender yes.
Cron is enabled, I set the Clident ID “IDxxxxxx”, what do you mean with “client secret”? the client password?
In my case i set the client password, but no results.

thanks for help.

Matteo

same here! the nextcloud manual was very helpful as I was new to cron jobs myself and it fixed my sync issue.

The client secret is what you get from creating a project in the Google API settings it is what is described in the text above the 2 fields you have to provide.

I am getting stuck at exactly the same place, however I don’t know how to check for the background jobs. Would be so kind enough to give some more details as to how you checked and resumed the background jobs?

Tried to check the cron jobs for www-data user by sudo crontab -u www-data -l shows no crontab for www-data

Can anyone here confirm if this app will import the photos with the metadata included in the jpg files? As you know Google Takeaout strips the metadata and puts into a separate json file.

I am looking for an easy way of backing up my Google Photos including the metadata.

Hi there,
I also would like to know how to access these background jobs. My NC is installed on a managed server, so maybe it has something to do with that? I am totally new at this, so sorry for asking dumb questions :sweat_smile:

Hello!
I went through all the steps in setting up the migration and everything works as it should except for the photo. Photo uploads only a small part of several thousand photos.
Neither in the Nextcloud logs nor on the Google side did I find any errors. There are any thoughts?

If anyone is getting same problem, try to run cronjob and it should fix your problem.

Steps :

  1. I assume , your are running web server as www-data and your Nextcloud is running under www-data user.

  2. Change to that user using command su www-data -s /bin/bash

  3. Check if any cronjobs are running , command crontab -l

  4. Create Crontab as required, I am ruuning cron.php , every 10 minutes ; Adjust time as required

  5. command */10 * * * * /usr/bin/php /path-to-nextcloud-root/cron.php

  6. Please, note your php path, it may be different for your enviroment.

After that , everything started syncing.

I have the same issue. How can you check the cron job? I am running Nextcloud in a container, not sure if it’s inside or I should do something on my host linux.
Thanks.

I went into my container:
docker exec -it nextcloud /bin/bash

Changed to www-data user:
su www-data -s /bin/bash

Found cron.php:

www-data@c6ca4725c85d:~$ find . | grep cron.php 
./html/cron.php

Went into its folder:
www-data@c6ca4725c85d:~$ cd html/

Executed this:
www-data@c6ca4725c85d:~/html$ php ./cron.php

It’s running in the foreground, but nothing happens with the migration of the photos, still saying:

0 photos imported
Photo import background process will begin soon. You can close this page. You will be notified when it finishes.

Cancel photo import

If I call it from the outside, does the same:
docker exec -it --user www-data nextcloud php /var/www/html/cron.php