Google Workspace has its hooks in everything: your email, your documents, your calendar, your contacts, your video calls, and even your file storage. Exporting all of that data into a self-hosted Nextcloud environment requires a systematic approach that addresses each service individually. This guide walks through every data category, from Drive files and email archives to calendar events and contact lists, with practical commands and processes for each.
For a broader perspective on why organizations are making this switch and what Nextcloud offers as a complete Google Workspace replacement, start with the complete guide to replacing Google and Microsoft with Nextcloud. If you are looking for the enterprise migration playbook with organizational planning, our enterprise Google Workspace to Nextcloud migration guide covers project management, stakeholder communication, and phased rollout strategies.
Google Takeout: Your Starting Point
What Google Takeout Exports
Google Takeout (takeout.google.com) is Google's official data export tool. It can export data from over 50 Google services, but for a Workspace migration, you care about these:
- Google Drive: All files including Google Docs, Sheets, Slides (converted to Microsoft or ODF formats), plus uploaded files in their original format.
- Gmail: Full email archive in MBOX format.
- Google Calendar: All calendars in ICS format.
- Google Contacts: All contacts in vCard (VCF) format.
- Google Keep: Notes exported as HTML.
- Google Chat: Chat history (if enabled by admin).
Running a Google Takeout Export
- Go to takeout.google.com while signed in to the Google Workspace account.
- Click "Deselect all" to start fresh, then select only the services you need (Drive, Mail, Calendar, Contacts).
- For Google Drive, click the options button to choose the export format for Google-native documents:
- Google Docs: Export as DOCX (best for OnlyOffice) or ODT (best for Collabora/LibreOffice).
- Google Sheets: Export as XLSX or ODS.
- Google Slides: Export as PPTX or ODP.
- Choose delivery method: Download link via email, or export directly to another cloud service.
- Select file type (ZIP or TGZ) and maximum archive size (2 GB, 4 GB, 10 GB, or 50 GB). For large accounts, choose 50 GB to minimize the number of split archives.
- Click "Create export" and wait. Large exports can take hours or even days.
Admin tip: Google Workspace admins can use the Data Export tool in the Admin Console (admin.google.com > Account > Data Export) to export all users' data at once. This is significantly more efficient than having each user run Takeout individually. Note that admin export includes all users and can only be run once every 30 days.
Google Takeout Limitations
Google Takeout is not perfect. Be aware of these limitations:
- No shared drive export: Takeout exports only files owned by the user, not files shared with them. Shared Drive content must be exported by a Shared Drive manager.
- Format conversion is lossy: Google Docs converted to DOCX or ODT may lose some formatting, especially complex layouts, linked documents, or embedded Google-specific features like smart chips.
- No incremental export: Takeout always exports everything. You cannot export only files changed since a specific date.
- Slow for large accounts: Accounts with 100+ GB of Drive data may take 24-48 hours to generate the export archive.
- Archive expiration: Download links expire after 7 days. Download promptly.
Google Drive Migration
Method 1: Rclone (Recommended for Bulk Migration)
Rclone provides the most reliable method for migrating Google Drive content to Nextcloud. It handles Google's native format conversion automatically and supports large-scale transfers.
# Install rclone
curl https://rclone.org/install.sh | sudo bash
# Configure Google Drive remote
rclone config
# Choose "New remote" > name: "gdrive" > type: "Google Drive"
# Follow OAuth2 flow; for Workspace, use a service account for bulk access
# Configure Nextcloud remote
rclone config
# Choose "New remote" > name: "nextcloud" > type: "WebDAV"
# URL: https://cloud.example.com/remote.php/dav/files/USERNAME/
# Vendor: Nextcloud
Handling Google-Native File Formats
Rclone can automatically convert Google Docs, Sheets, and Slides during transfer. Configure the export format in your rclone remote settings:
# In rclone.conf, add to your Google Drive remote:
[gdrive]
type = drive
# ... other settings ...
# Export Google Docs as DOCX
--drive-export-formats docx,xlsx,pptx
# Or export as ODF (for Collabora Online)
--drive-export-formats odt,ods,odp
For organizations using Collabora Online as their document editor, ODF formats (ODT, ODS, ODP) are the native format and offer the best fidelity. For OnlyOffice, DOCX/XLSX/PPTX is the better choice. See our Collabora Online setup guide for configuration details.
Running the Migration
# Dry run first
rclone copy gdrive: nextcloud:/migrated-from-google/ \
--drive-export-formats docx,xlsx,pptx \
--dry-run \
--progress
# Execute migration
rclone copy gdrive: nextcloud:/migrated-from-google/ \
--drive-export-formats docx,xlsx,pptx \
--transfers 4 \
--checkers 8 \
--progress \
--log-file=/var/log/gdrive-migration.log \
--retries 3 \
--retries-sleep 10s
# For service account bulk migration (all users)
# Requires domain-wide delegation configured in Google Admin
rclone copy gdrive,shared_with_me: nextcloud:/migrated/ \
--drive-impersonate user@company.com \
--drive-export-formats docx,xlsx,pptx
Method 2: Google Takeout + Manual Upload
If rclone is not feasible, use Google Takeout to download ZIP archives, extract them locally, and upload to Nextcloud via the desktop client or web interface. This method is straightforward but does not scale well for organizations with many users or large data volumes.
Shared Drives Migration
Google Workspace Shared Drives (formerly Team Drives) require special handling because they are owned by the organization, not individual users. To migrate Shared Drives:
- Use rclone with the
--drive-shared-with-meflag or configure access to specific Shared Drives. - Map each Shared Drive to a Nextcloud Group Folder. This preserves the concept of team-owned storage that is not tied to an individual.
- Assign appropriate group permissions on the Nextcloud side before migrating data.
# List available Shared Drives
rclone lsd gdrive,shared_with_me:
# Copy a specific Shared Drive to a Group Folder path
rclone copy "gdrive,team_drive=TEAM_DRIVE_ID:" nextcloud:/Marketing/ \
--drive-export-formats docx,xlsx,pptx \
--progress
Preserving Folder Structure and Permissions
Google Drive's sharing model is per-file and per-folder, which is more granular than what most organizations need in Nextcloud. During migration, simplify where possible:
- Files shared with "anyone with the link" should be reviewed; recreate only the ones that are actively used as Nextcloud public shares.
- Files shared with specific people should be placed in shared folders or Group Folders with the appropriate group access.
- Deeply nested sharing (a file 5 levels deep shared with someone outside the parent folder's access) should be restructured into a more logical hierarchy.
Gmail Export and Email Migration
Option 1: IMAP Migration (Recommended)
The most reliable way to migrate email is IMAP-to-IMAP sync using imapsync. This requires a destination mail server (Nextcloud is not a mail server, but Nextcloud Mail can connect to any IMAP server).
# Install imapsync
sudo apt-get install imapsync
# Migrate a single mailbox
imapsync \
--host1 imap.gmail.com --port1 993 --ssl1 \
--user1 user@company.com --password1 "app-password" \
--host2 mail.newserver.com --port2 993 --ssl2 \
--user2 user@company.com --password2 "new-password" \
--gmail1 \
--automap \
--exclude "^\[Gmail\]/All Mail$" \
--exclude "^\[Gmail\]/Spam$"
# The --gmail1 flag handles Gmail-specific label-to-folder mapping
Gmail uses labels instead of folders. A single email can have multiple labels, meaning it appears in multiple "folders." When migrating to a traditional IMAP server, imapsync handles this by copying the email to each corresponding folder. This may increase total mailbox size. Use
--excludeflags to skip "All Mail" and other aggregate labels to avoid duplication.
Option 2: MBOX Import
If you used Google Takeout to export Gmail, you have MBOX files. These can be imported into most mail servers:
- For Dovecot-based mail servers, use
doveadm importto import MBOX files directly. - For other mail servers, convert MBOX to Maildir format using tools like
mb2md, then import. - Thunderbird can also import MBOX files and then sync them to your new IMAP server via drag-and-drop.
Option 3: Keep Gmail, Connect via Nextcloud Mail
The simplest email option is to keep Gmail running and connect it to Nextcloud Mail via IMAP. This gives users a unified interface without actually migrating email. This is a viable transitional strategy, but it means Google still has your email data.
Google Calendar Export to Nextcloud (CalDAV)
Method 1: ICS Export and Import
- In Google Calendar, go to Settings > Import & Export > Export. This downloads a ZIP file containing ICS files for each calendar.
- In Nextcloud Calendar, click the three-dot menu next to a calendar name and select "Import." Upload the ICS file.
- Repeat for each calendar.
Method 2: CalDAV Sync (For Ongoing Synchronization)
If you need a transition period where both calendars stay in sync, use a CalDAV bridge or sync tool. However, this is complex and usually not worth the effort for a one-time migration.
Handling Shared Calendars
Google Calendar shared calendars require coordination:
- The calendar owner exports the calendar.
- Import it into Nextcloud under the owner's account.
- Share the Nextcloud calendar with the same group of people using Nextcloud's calendar sharing feature.
- For room/resource calendars, create dedicated Nextcloud calendars and share them with the entire organization.
Recurring Event Considerations
Recurring events are the most fragile part of any calendar migration. Google Calendar uses RFC 5545 (iCalendar) for export, which Nextcloud also supports. However, watch for these edge cases:
- Events with exceptions (single occurrences modified or deleted from a series) may not transfer perfectly.
- Events spanning timezone changes can shift by an hour if timezone identifiers do not match exactly.
- Google-specific features like "Out of Office" blocks and "Focus Time" do not have direct Nextcloud equivalents.
Test a representative sample of complex recurring events before migrating all calendars.
Google Contacts Export to Nextcloud (CardDAV)
Export from Google
- Go to contacts.google.com.
- Click the gear icon > Export.
- Select "vCard (for iOS Contacts)" format. This produces a .vcf file compatible with CardDAV.
- Alternatively, export as Google CSV if you need to clean up data in a spreadsheet before importing.
Import into Nextcloud
- Open the Nextcloud Contacts app.
- Click the settings gear in the bottom-left sidebar.
- Click "Import contacts" and select the .vcf file.
- Contacts will be imported into the selected address book.
Contact Groups
Google Contacts groups (labels) are exported as part of the vCard data. Nextcloud Contacts supports contact groups, but the mapping is not always clean. After import, verify that groups transferred correctly and recreate any that did not.
Shared Contact Lists
Google Workspace's Directory (the organization-wide contact list) does not export through individual Takeout. Workspace admins can export the directory via the Admin SDK. Import this into a shared Nextcloud address book that is accessible to all users.
Google Keep Notes
Google Takeout exports Keep notes as HTML files. These can be imported into Nextcloud in a few ways:
- Nextcloud Notes app: Manually copy note content into Nextcloud Notes (Markdown format). This is tedious but produces clean results.
- Upload as HTML: Place the exported HTML files in a Nextcloud folder. They will be viewable but not editable as notes.
- Convert to Markdown: Use a tool like
pandocto convert HTML notes to Markdown, then import into Nextcloud Notes.
# Batch convert Keep HTML notes to Markdown
for f in Keep/*.html; do
pandoc "$f" -f html -t markdown -o "notes/$(basename "$f" .html).md"
done
Google Forms Data
Google Forms cannot be directly migrated to Nextcloud Forms. However, you can preserve the data:
- Export form responses to Google Sheets, then download as XLSX/CSV.
- Recreate active forms in Nextcloud Forms (the form structure must be rebuilt manually).
- For archived forms, keep the exported spreadsheet data in Nextcloud for reference.
Post-Migration Data Verification
After migrating each data category, verify the transfer:
| Data Type | Verification Method | Acceptable Variance |
|---|---|---|
| Drive files | Compare file counts via rclone check | Less than 1% (empty Google Docs may not export) |
| Compare mailbox message counts | Less than 0.5% (drafts and spam may differ) | |
| Calendar | Spot-check 10 events including recurring | All events present; times correct |
| Contacts | Compare contact counts | Exact match expected |
Need Help with Your Migration?
MassiveGRID's managed Nextcloud hosting includes migration assistance, ensuring a smooth transition from your current platform.
Explore Managed Nextcloud HostingGoogle Workspace License Wind-Down
Maintain Google Workspace licenses for at least 30 days post-migration. During this period, set up email forwarding from Gmail to your new mail server (if applicable), and verify that all data has been successfully transferred. Downgrade to a lower-tier plan if possible to reduce costs during the overlap period.
What Comes Next
Exporting your data is the technical half of the migration. The human half, getting your team comfortable with Nextcloud, is equally important. Our team onboarding playbook for Nextcloud provides a structured approach to training users at every skill level, from basic file operations to advanced collaboration features. The playbook includes feature mapping tables that show users exactly where to find the Nextcloud equivalent of every Google Workspace tool they are accustomed to using.
For the broader context of this migration, including the strategic reasoning behind moving from Google to a self-hosted platform, refer back to the complete guide to replacing Google and Microsoft with Nextcloud.