AI · Tech · Science · Crypto · Linux · Gaming · DIY · Guides
💻 Tech · Tech

Practical Guide: Migrating Your Photos from Google to Self-Hosted Nextcloud

2386 words · 11 min read

Practical Guide: Migrating Your Photos from Google to Self-Hosted Nextcloud

Google Photos surpassed 1 billion users by 2019, and for good reason: it was free, unlimited, and effortless. Then Google ended free unlimited storage in 2021, and suddenly your 15 GB cap started filling up fast. Add growing discomfort about a single company scanning, analyzing, and monetizing your personal memories, and the appeal of self-hosting starts to make sense.

Nextcloud — an open-source platform with over 400,000 active installations as of 2023 — gives you a Google Photos alternative that runs on hardware you control. No subscription fees. No facial recognition algorithms feeding ad profiles. No terms of service changes that alter how your data gets used.

The migration isn't trivial, but it's also not as hard as it sounds. What follows is a practical, step-by-step guide to moving your entire photo library from Google to Nextcloud.

Key Takeaway: You're trading convenience for control. The migration takes effort upfront, but once it's done, you own your photos outright — no recurring fees, no privacy trade-offs.


1. Export Your Google Photos Library with Google Takeout

Google Takeout is the official export tool, and it's the only reliable way to get your photos out of Google's ecosystem. The interface is clunky, but it works.

How to Use Google Takeout

  1. Go to takeout.google.com and sign in.
  2. Click "Deselect all" to clear the default selections.
  3. Scroll down and check only "Google Photos."
  4. Click "Multiple formats" and verify photos export as original quality (not compressed).
  5. Choose your export destination — a download link, Google Drive, Dropbox, or OneDrive.
  6. Select export frequency: one-time (for migration) or every two months (for ongoing backup).
  7. Choose file type and size: ZIP is standard; 50 GB is the maximum per archive.
  8. Click "Create export."

Google will email you when the archive is ready. For large libraries, this can take hours or even days.

Understanding Export Size Limits

Google Takeout caps each archive at 50 GB. If your library exceeds that — say a 200 GB collection — you'll get four or more separate ZIP files. A typical smartphone photo runs 2–5 MB, so 100 GB translates to roughly 20,000–50,000 images. Plan accordingly.

What You Actually Get

  • Original quality photos and videos (if you selected that option)
  • Preserved folder structure and filenames
  • JSON metadata files for each photo containing album names, descriptions, and timestamps
  • Separate folders for albums, shared albums, and the main library

The JSON files are critical. Google stores album membership and some metadata outside the image files themselves. Without processing those JSONs, you'll lose album organization and some date information.

Key Takeaway: Always export in original quality. Compressed exports permanently degrade your photos, and you can't undo it later.


2. Prepare Your Nextcloud Instance for the Import

Before you upload a single photo, your Nextcloud server needs to be ready. This step prevents headaches later.

Installation Options

  • Personal server: A dedicated machine (old PC, Raspberry Pi, or VPS) running Nextcloud. Full control, requires technical setup.
  • NAS: Many Synology, QNAP, and TrueNAS devices support Nextcloud via Docker or native packages. Easier setup, less flexibility.
  • Managed hosting: Providers like Hetzner, IONOS, or specialized Nextcloud hosts handle the infrastructure. You pay monthly but skip the sysadmin work.

Storage Planning

Estimate your total photo library size, then add 20% overhead for thumbnails, previews, and database growth. A 500 GB photo library needs at least 600 GB of usable storage. Nextcloud generates preview images for every photo, which can add significant space depending on your configuration.

If you're running Nextcloud on a Raspberry Pi with an external drive, make sure the drive is formatted with a filesystem that supports large files (ext4, Btrfs, or XFS — avoid FAT32).

Pre-Import Checklist

  • Update Nextcloud to the latest stable version
  • Verify PHP memory limits (512 MB minimum for large imports)
  • Check available disk space
  • Set up a backup before importing (yes, before)
  • Configure your database (MySQL/MariaDB or PostgreSQL recommended over SQLite for large libraries)

Key Takeaway: Don't skip the preparation. Importing 50,000 photos into an underpowered or misconfigured server will cause timeouts, failed uploads, and database errors.


3. Extract and Organize Your Takeout Archives

Once your Takeout archives arrive, you need to unpack and organize them before uploading.

Downloading and Extracting

Download all ZIP parts to a local drive with enough free space. If you have 10 files named takeout-20240101T120000Z-001.zip through -010.zip, extract them all into the same parent folder. Most archive tools (7-Zip, WinRAR, macOS Archive Utility) handle multi-part extraction automatically if the files are in the same directory.

After extraction, you'll typically see a Takeout/Google Photos/ folder containing:

  • Photos from 2023/ — chronological folders
  • Albums/ — one folder per album
  • JSON files alongside each image

Understanding the Folder Structure

Google's export structure is inconsistent. Some photos appear in both the chronological folder and an album folder. Some albums contain copies, not references. You'll likely need to deduplicate after import.

Merging JSON Metadata into EXIF

This is optional but recommended. Third-party tools like google-photos-takeout-helper can read the JSON files and write the metadata back into each photo's EXIF data. This preserves:

  • Original capture date (critical for timeline view)
  • GPS coordinates
  • Descriptions and captions
  • Album names

Without this step, Nextcloud may use the file modification date instead of the actual capture date, scrambling your timeline.

# Example using google-photos-takeout-helper
gpth process --input ./Takeout/Google\ Photos --output ./processed

Run this on a copy of your data, not the originals. Verify a sample of photos before processing the entire library.

Key Takeaway: Merging JSON metadata into EXIF before upload saves hours of manual sorting later. Nextcloud's timeline depends on accurate capture dates.


4. Upload Your Photos to Nextcloud

You have four main options, depending on library size and technical comfort.

Method A: Web Interface (Small Libraries)

Drag and drop files into the Nextcloud web UI. Works fine for a few hundred photos. Beyond that, browser timeouts and memory limits become problems. Not recommended for libraries over 5 GB.

Method B: Desktop Client (Medium Libraries)

Install the Nextcloud desktop client, point it at a local folder containing your extracted photos, and let it sync. This is the most user-friendly approach for libraries up to a few hundred gigabytes. The client handles chunked uploads, retries, and conflict resolution automatically.

Setup:

  1. Install the Nextcloud desktop client
  2. Connect to your server
  3. Choose or create a sync folder
  4. Copy your photos into that folder
  5. Wait — syncing 100 GB over a typical connection takes hours or days

Method C: Direct File Placement + occ files:scan (Large Libraries)

For libraries over 500 GB, the fastest method is to bypass the upload process entirely:

  1. Copy your photos directly into the Nextcloud data directory on the server (e.g., /var/www/nextcloud/data/username/files/Photos/)
  2. Set correct ownership: chown -R www-data:www-data /path/to/files
  3. Run the scan command:
sudo -u www-data php occ files:scan --all
# Or for a specific user:
sudo -u www-data php occ files:scan username

This tells Nextcloud to index the files without uploading them through the web stack. It's dramatically faster for large libraries.

Method D: rclone or WebDAV (Advanced)

rclone supports WebDAV as a backend, letting you transfer files from Google Drive, a local disk, or cloud storage directly to Nextcloud:

rclone copy /local/photos nextcloud:Photos --progress

This is useful for scripted or automated transfers, especially for ongoing syncs.

Key Takeaway: For libraries over 500 GB, direct file placement with occ files:scan is the only practical method. Uploading terabytes through a web interface will fail.


5. Organize and Manage Your Photos in Nextcloud

Once your photos are indexed, the Nextcloud Photos app takes over.

The Timeline View

Nextcloud's Photos app groups images by date, similar to Google Photos. This works best when EXIF data is intact. If your photos show up under the wrong dates, the JSON metadata merge step (Section 3) was likely skipped or failed.

Albums and Favorites

You can create albums manually, add photos to favorites, and share albums with other Nextcloud users. Album creation is manual — Nextcloud doesn't automatically recreate your Google Photos albums unless you script it or use a tool that reads the JSON album data.

Scripting Album Creation

For large libraries with many albums, consider a script that reads the JSON files and creates corresponding albums via the Nextcloud API or occ commands. This is advanced but saves significant manual effort.

EXIF-Based Organization

Nextcloud reads EXIF data for:

  • Date taken (timeline sorting)
  • GPS coordinates (map view, if enabled)
  • Camera model (filtering)

Ensure your photos have clean EXIF data before import for the best results.

Key Takeaway: Nextcloud's Photos app is functional but less polished than Google Photos. Expect to do more manual organization, especially for albums.


6. Set Up Automatic Mobile Uploads to Replace Google Photos Backup

The whole point of this migration is to stop relying on Google. That means configuring your phone to upload new photos directly to Nextcloud.

Installing the Mobile App

Download the Nextcloud app for iOS or Android. Connect it to your server using your credentials or a generated app password.

Configuring Auto-Upload

  1. Open the app and go to Settings
  2. Find "Auto upload" or "Instant upload"
  3. Enable it for photos and/or videos
  4. Choose the destination folder on your server
  5. Set upload conditions (Wi-Fi only, charging only, etc.)

On Android, you may need to disable battery optimization for the Nextcloud app to ensure background uploads work reliably. On iOS, background uploads are more restricted — the app uploads when opened or when iOS permits background activity.

Managing Upload Settings

  • Wi-Fi only: Saves mobile data, but delays uploads until you're home
  • Charging only: Reduces battery drain
  • Subfolder organization: Some versions support organizing uploads by year/month

Test the setup by taking a photo and confirming it appears on your server within a few minutes.

Key Takeaway: Mobile auto-upload works, but it's not as seamless as Google Photos. Expect occasional manual intervention, especially on iOS.


7. Maintain and Secure Your Self-Hosted Photo Library

Self-hosting means you're responsible for backups, updates, and security. This is the part Google handled for you.

Backups: Local and Off-Site

Follow the 3-2-1 rule: three copies, two different media, one off-site.

  • Local backup: External drive or NAS, synced regularly
  • Off-site backup: Cloud storage (Backblaze B2, Wasabi), a remote server, or physical drives stored elsewhere
  • Test restores: A backup you've never restored isn't a backup

Nextcloud has a built-in backup app, but for photos, a simple rsync or Borg backup of the data directory is often more reliable.

Keeping Nextcloud Updated

Security patches matter. Nextcloud releases updates regularly, and running an outdated version exposes you to known vulnerabilities. Set up automatic minor updates if your hosting supports it, and schedule major version upgrades during low-traffic periods.

Monitoring Storage and Performance

  • Watch disk usage — photo libraries grow faster than you expect
  • Monitor database size and query performance
  • Check preview generation settings; disabling previews for videos saves significant space

Sharing Photos Securely

Nextcloud supports public share links with optional passwords and expiration dates. For sharing with family, create user accounts instead of public links. For external sharing, use password-protected links and set expiration dates.

Key Takeaway: Self-hosting is ongoing work. Budget a few hours per month for maintenance, updates, and backup verification.


Frequently Asked Questions

How do I export my photos from Google Photos? Use Google Takeout at takeout.google.com. Select only Google Photos, choose original quality, and download the resulting ZIP archives.

Can I import Google Takeout directly into Nextcloud? Not directly. You need to extract the archives first, then upload via the web interface, desktop client, or direct file placement.

Will my albums and metadata be preserved? Album information is stored in JSON files, not in the photos themselves. You'll need to merge that metadata into EXIF or recreate albums manually in Nextcloud.

How long does the migration take? For a 100 GB library: a few hours to export, a few hours to extract and process, and 1–3 days to upload depending on your connection and method.

Is Nextcloud free? The software is free and open-source. You'll pay for hardware, hosting, or a managed provider if you don't self-host.

Can I automatically sync new photos from my phone to Nextcloud? Yes, using the Nextcloud mobile app's auto-upload feature. Reliability varies by platform.

What are the storage requirements for self-hosting Nextcloud? Plan for your photo library size plus 20% overhead for previews and database growth. A 500 GB library needs at least 600 GB.

How do I handle the JSON files from Google Takeout? Use a tool like google-photos-takeout-helper to merge JSON metadata into photo EXIF data before uploading.

Is Nextcloud secure for storing personal photos? Yes, if properly configured. Use HTTPS, strong passwords, two-factor authentication, and keep the software updated.

Can I share photos from Nextcloud with others? Yes. You can create public links, share with specific users, or set up password-protected shares with expiration dates.


Conclusion: Taking Control of Your Photo Library

Migrating from Google Photos to Nextcloud isn't a one-click process. It involves exporting, extracting, processing metadata, uploading, and ongoing maintenance. But the payoff is real: you own your photos, you control who sees them, and you stop paying rent on your own memories.

The steps in this guide — Takeout export, server prep, metadata merging, upload, organization, mobile sync, and maintenance — cover the full lifecycle. Start with the export, take your time with the metadata, and don't rush the upload.

Once it's done, you'll have a photo library that answers to you and no one else.

Ready to take control of your photos? Start your migration today by exporting your Google Photos library with Google Takeout and setting up your own Nextcloud instance. For step-by-step guidance, check out our detailed tutorial and join the community of self-hosters who value privacy and ownership.