Tool to import Google Photos Takeout into Nextcloud
Find a file
Rik Meijer 23823dc01e
Fix URL format in README for NEXTCLOUD_URL
Thanks @koenbeek (#24) for noticing this typo
2026-01-01 14:49:57 +01:00
.github/workflows also build arm docker image 2025-01-30 09:28:29 +01:00
docker increase disk cache size 2025-05-27 13:46:17 +02:00
nbproject initial 2025-01-27 15:57:25 +01:00
src fix missing class 2025-06-23 15:49:47 +02:00
.DS_Store improve README.md 2025-06-11 09:21:22 +02:00
.gitignore expect NEXTCLOUD_URL as env var 2025-02-10 16:40:14 +01:00
composer.json lose amp dependency 2025-06-19 08:22:30 +02:00
composer.lock lose amp dependency 2025-06-19 08:22:30 +02:00
Dockerfile Update Dockerfile, fix composer 2025-11-06 06:22:38 +01:00
gp2nc.php Update gp2nc.php 2025-12-28 07:15:38 +01:00
LICENSE Initial commit 2025-01-27 10:29:53 +01:00
README Fix URL format in README for NEXTCLOUD_URL 2026-01-01 14:49:57 +01:00

Requires Nextcloud Photos app to be installed, because of albums.

Replace NEXTCLOUD_URL with the following: https://<USER>:<APP_PASSWORD>@nextcloud.example.org/Photos
--> /Photos can be any path in Nextcloud to import photos to
Optionally, setting a NEXTCLOUD_PREFIX allows nextcloud to be in a sub dir.
# nextcloud url: https://web.hos.st/nextcloud
NEXTCLOUD_PREFIX=nextcloud # no leading or trailing /!

# Run from command line (in /path/to/Takout/Google Photos, where photo directories and jsons are residing)
# Imagick extension required (with ffmpeg for video exif data)
```.env
NEXTCLOUD_URL=<NEXTCLOUD_URL> # e.g. https://user:s3cr3t@cloud.example.com/Photos
NEXTCLOUD_USER=usernamehere # Optional, overwrites user in NEXTCLOUD_URL
NEXTCLOUD_PASSWORD=secret # Optional, overwrites password in NEXTCLOUD_URL
```
```
$ php gp2nc.php
```

# Run with docker
"/path/to/Takeout/Google Photos" is the path where the general json files (e.g. user-generated-memory-titles.json) of your Takeout reside.

```
docker build . -t gp2nc
docker run --rm -v "/path/to/Takeout/Google Photos":/photos -e NEXTCLOUD_URL=<NEXTCLOUD_URL> gp2nc
```
or use ready2use image (auto-build)
```
docker run --rm -v "/path/to/Takeout/Google Photos":/photos -e NEXTCLOUD_URL=<NEXTCLOUD_URL> ghcr.io/rikmeijer/googlephotos2nextcloud:latest
```

# Known errors

Disk cache limit is set to 32GiB, files requiring larger cache will exhaust this and result in an error like:
```
Failed reading metadata: cache resources exhausted
```

# If you like this tool

Donations are [welcome](https://rikmeijer.github.io)