Skip to content

Website Migration Guide

Goal: Migrate your existing website to Astro Swiss Theme with minimal friction.

This guide walks you through migrating an existing website to the Astro Swiss Theme. Whether you’re coming from WordPress, a static site, or another framework, these steps will help you transition smoothly.

Time estimate: 4-6 hours for a complete migration


Content Audit

Extract and inventory all content from your existing site.

Setup & Configuration

Install the template and configure company information.

Content Migration

Map your data to the template structure.

Deploy

Test thoroughly and deploy to production.


Before touching any code, inventory all content from your existing website.

Create a spreadsheet or document with these sections:

Essential details:

  • Company name
  • Address (street, PO box, city, postal code)
  • Phone number(s)
  • Email address(es)
  • Social media links (LinkedIn, Facebook, Instagram, Twitter, GitHub)
  • Google Maps URL

Example structure:

Company Name: Your Company Name
Address: Street Address 123
City: CH-1000 Your City
Phone: +41 XX XXX XX XX
Email: contact@example.com
LinkedIn: https://www.linkedin.com/company/yourcompany/
Instagram: https://www.instagram.com/yourcompany/

Collect all assets you’ll need:

  • Logo (SVG format preferred, or high-res PNG)
  • Team photos (square format, 240x240px minimum)
  • Portfolio images (800x600px recommended)
  • Favicon (if you have a custom one)
  • Brand colors (hex codes)

Organize your assets:

migration-assets/
├── logo/
│ └── company-logo.svg
├── team/
│ ├── person1.jpg
│ └── person2.jpg
├── portfolio/
│ ├── project1.jpg
│ └── project2.jpg
└── brand-colors.txt

  1. Clone the repository

    Terminal window
    # Free starter theme (public repository)
    git clone https://github.com/vincentheimann/astro-swiss-free-starter-theme.git
    cd astro-swiss-free-starter-theme
  2. Install dependencies

    Terminal window
    npm install
  3. Start development server

    Terminal window
    npm run dev

    Visit http://localhost:4321 to see the template.

Track your changes with version control:

Terminal window
git init
git add .
git commit -m "Initial commit - Astro Swiss template"

Now replace the demo content with your actual company information.

File: src/consts.ts

Replace the COMPANY object with your information:

src/consts.ts
export const COMPANY: CompanyInfo = {
name: "Your Company Name",
address: "Your Street Address",
pobox: "", // Leave empty if not used
city: "CH-1000 Your City",
phone: "+41 XX XXX XX XX",
email: "contact@example.com",
mapsUrl: "https://maps.google.com/?q=Your+Address",
socials: {
linkedin: "https://www.linkedin.com/company/yourcompany/",
facebook: "",
instagram: "",
twitter: "",
github: "",
},
};

File: src/i18n/ui.ts

Update the site title, description, and business information for each language:

src/i18n/ui.ts
fr: {
'site.title': 'Your Company | Your Tagline',
'site.description': 'Your SEO-optimized description here',
'business.tagline': 'Your compelling tagline',
'business.description': 'Brief description of your business and what you do',
// ... keep other translations
}

If your primary language is different from French, update:

File: astro.config.mjs

astro.config.mjs
i18n: {
defaultLocale: "fr", // Change to "de", "en", etc. if needed
locales: ["fr", "de"], // List all languages you support
routing: {
prefixDefaultLocale: false,
},
},

File: src/i18n/ui.ts

src/i18n/ui.ts
export const defaultLang: Language = 'fr'; // Match astro.config.mjs

The template includes a Services section. Let’s customize it with your offerings.

File: src/i18n/ui.ts

Update the services section for each language:

src/i18n/ui.ts
fr: {
// ... other translations ...
'services.title': 'Our Services',
'services.subtitle': 'Comprehensive solutions for your needs',
'services.service1.title': 'Your Service 1',
'services.service1.description': 'Description of your first service',
'services.service2.title': 'Your Service 2',
'services.service2.description': 'Description of your second service',
// Add more services as needed
}

Repeat for German and any other languages.

File: src/components/ServicesSection.astro

The template uses Tabler Icons. Change icons to match your services:

src/components/ServicesSection.astro
const services = [
{ icon: 'code', key: 'service1' }, // Development
{ icon: 'users', key: 'service2' }, // Consulting
{ icon: 'palette', key: 'service3' }, // Design
{ icon: 'rocket', key: 'service4' }, // Launch
// ... etc
];

Browse available icons at Tabler Icons.


If you have team members to showcase, add them to the template.

File: src/consts.ts

Add employees to the EMPLOYEES object:

src/consts.ts
export const EMPLOYEES: Record<string, EmployeeInfo> = {
ABC: {
id: "ABC",
name: "Alice Brown",
portrait: "/images/team/alice.jpg", // Add photo to public/images/team/
email: "alice@example.com",
phone: "+41 XX XXX XX XX",
socials: {
linkedin: "https://www.linkedin.com/in/alicebrown/",
facebook: "",
instagram: "",
twitter: "",
github: "",
},
},
// Add more team members as needed
};

File: src/i18n/ui.ts

Add title and bio for each employee:

src/i18n/ui.ts
fr: {
// ... other translations ...
'employee.ABC.title': 'Founder & CEO',
'employee.ABC.bio': 'Brief bio describing experience and expertise.',
}
  1. Place team photos in public/images/team/
  2. Recommended size: 240x240px (square)
  3. Optimize images before adding

Showcase your work with portfolio projects.

  1. Create folder: src/assets/portfolio/
  2. Add your project images (800x600px recommended)
  3. Optimize images before adding

File: src/data/portfolio/fr.ts

src/data/portfolio/fr.ts
import { nanoid } from "nanoid";
import type { ImageMetadata } from "astro";
// Import your project images
import project1 from "../../assets/portfolio/project1.jpg";
import project2 from "../../assets/portfolio/project2.jpg";
export const portfolioFr: PortfolioProject[] = [
{
id: nanoid(),
title: "Project Title",
description: "Detailed project description.\n\nMultiple paragraphs supported.",
image: project1,
primaryCtaText: "View Details →",
primaryCtaLink: "#", // Add link if you have a project page
},
{
id: nanoid(),
title: "Another Project",
description: "Another project description.",
image: project2,
},
// Add more projects...
];

Repeat for German (src/data/portfolio/de.ts) with translated content.


Make the template match your brand identity.

File: src/styles/tokens.css

Find the color definitions and update them:

src/styles/tokens.css
@theme {
/* Primary Brand Color */
--color-primary-50: #f0f9ff;
--color-primary-100: #e0f2fe;
--color-primary-500: #0ea5e9; /* Main brand color */
--color-primary-600: #0284c7;
--color-primary-700: #0369a1;
/* Adjust other shades as needed */
}
  1. Prepare your logo:

    • SVG format preferred (scalable, small file size)
    • Or PNG with transparent background (high resolution)
  2. Add logo file:

    • Place in public/images/
    • Example: public/images/logo.svg
  3. Update logo references:

    File: src/components/Header.astro

    src/components/Header.astro
    <img
    src="/images/logo.svg"
    alt="Your Company Name"
    class="h-8 w-auto"
    />

    Update footer logo in src/components/Footer.astro if present.

Replace public/favicon.svg with your own favicon:

  • SVG format recommended
  • Or use PNG (32x32px minimum)

The template supports French and German by default. Configure languages based on your needs:

If you want to support both French and German:

  1. ✅ Ensure all translations are complete in src/i18n/ui.ts
  2. ✅ Add content to both src/data/portfolio/fr.ts and de.ts
  3. ✅ Test both language versions

The template includes a contact form. Configure it to receive submissions.

The default setup uses a mailto: link. Update the email in:

File: src/components/ContactSection.astro

src/components/ContactSection.astro
<form action={`mailto:${COMPANY.email}`} method="post" enctype="text/plain">

This opens the user’s email client. No server setup required.

For a better user experience, integrate with a form service:

Popular options:

Example with Formspree:

  1. Sign up at formspree.io

  2. Create a new form and get your form endpoint

  3. Update the form action:

    src/components/ContactSection.astro
    <form action="https://formspree.io/f/YOUR_FORM_ID" method="POST">

Before deploying, thoroughly test your migrated site.

Go through each section and verify:

  1. Header/Navigation

    • ✅ Logo displays correctly
    • ✅ Navigation links work
    • ✅ Language switcher works (if multilingual)
    • ✅ Dark mode toggle works
  2. Hero Section

    • ✅ Company name and tagline are correct
    • ✅ CTA button links to the right place
  3. Services Section

    • ✅ All services display correctly
    • ✅ Icons are appropriate
    • ✅ Descriptions are accurate
  4. Portfolio Section

    • ✅ Projects display in carousel
    • ✅ Images load correctly
    • ✅ Lightbox works when clicking images
    • ✅ CTAs link to correct destinations
  5. Team Section (if applicable)

    • ✅ Team members display correctly
    • ✅ Photos load or avatars generate
    • ✅ Social links work
  6. Contact Section

    • ✅ Form fields are labeled correctly
    • ✅ Company information is accurate
    • ✅ Map link works
    • ✅ Social media links work
  7. Footer

    • ✅ Copyright information is correct
    • ✅ Links work

If supporting multiple languages:

  • ✅ Switch between languages and verify all content
  • ✅ Check that URLs are correct (/ for default, /de/ for German)
  • ✅ Verify language preference persists on page reload
  • ✅ Test all sections in each language

Test on different screen sizes:

  • Desktop (1920px, 1440px, 1024px)
  • Tablet (768px)
  • Mobile (375px, 414px)

Use browser DevTools to test responsive breakpoints.

Run a Lighthouse audit:

  1. Open Chrome DevTools (F12)
  2. Go to “Lighthouse” tab
  3. Run audit for “Performance”, “Accessibility”, “Best Practices”, “SEO”
  4. Aim for scores 90+ in all categories

Common issues:

  • Large images → Optimize with TinyPNG
  • Missing alt text → Add to all images
  • Slow loading → Check image sizes and formats

Once testing is complete, deploy your site to production.

Terminal window
npm run build

This creates an optimized production build in the dist/ folder.

Test the production build locally:

Terminal window
npm run preview

The template works with any static hosting provider. Popular options:

Netlify (Recommended)

  1. Push your code to GitHub
  2. Sign up at netlify.com
  3. Click “Add new site” → “Import from Git”
  4. Select your repository
  5. Build settings:
    • Build command: npm run build
    • Publish directory: dist
  6. Click “Deploy”

Custom domain: Follow Netlify’s guide to add your domain.

Vercel

  1. Push your code to GitHub
  2. Sign up at vercel.com
  3. Click “New Project”
  4. Import your repository
  5. Vercel auto-detects Astro settings
  6. Click “Deploy”

Other Hosts

The template works with:

  • Cloudflare Pages
  • AWS Amplify
  • Azure Static Web Apps
  • Any host supporting static sites

See the Deployment Guide for provider-specific instructions.


Track your website traffic with Google Analytics:

  1. Create a Google Analytics 4 property
  2. Get your Measurement ID (format: G-XXXXXXXXXX)
  3. Set up Google Tag Manager

See the Analytics Guide for detailed setup instructions.

Improve your search engine visibility:

  1. Submit sitemap to Google Search Console:

  2. Verify Open Graph tags:

    • Test with OpenGraph.xyz
    • Ensure preview image displays correctly
  3. Test structured data:


Issue: “Module not found” errors

Solution:

Terminal window
# Delete node_modules and reinstall
rm -rf node_modules package-lock.json
npm install

Use this checklist to track your migration progress:

  • Content inventory completed
  • Visual assets collected
  • Brand colors documented
  • Template downloaded and extracted
  • Dependencies installed (npm install)
  • Dev server running (npm run dev)
  • Company information updated (src/consts.ts)
  • Site metadata updated (src/i18n/ui.ts)
  • Default language configured
  • Services added and translated
  • Team members added (if applicable)
  • Portfolio projects added
  • All translations completed
  • Brand colors updated (src/styles/tokens.css)
  • Logo added and referenced
  • Favicon updated
  • All sections reviewed
  • Multilingual content tested
  • Responsive design tested
  • Performance audit passed (Lighthouse 90+)
  • Contact form tested
  • Production build successful (npm run build)
  • Production preview tested (npm run preview)
  • Site deployed to hosting provider
  • Custom domain configured
  • SSL certificate active (HTTPS)
  • Analytics set up (optional)
  • Sitemap submitted to Google Search Console
  • Open Graph tags verified
  • Final cross-browser testing

Congratulations on migrating to Astro Swiss! 🎉

Customization Guide

Component customization and advanced features.

Learn More →