Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Move a XAMPP site as an application migration, not as a folder copy: export a logical database dump, copy the application files, recreate Apache, PHP and a database service on Ubuntu, test the VPS privately, then change DNS and enable HTTPS. Keep the local project, database dump and configuration backups until the public site has remained healthy through your observation window.

What changes when a XAMPP site goes to a VPS?

XAMPP is a development stack. Your local installation bundles web serving, PHP and a MySQL-compatible database, but an Ubuntu VPS starts as an operating-system image. You must recreate those services, configure them for your application and secure the machine before sending visitors to it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The migration has two independent payloads:

  • Application files: PHP code, templates, CSS, JavaScript, images, uploaded media and any other assets in the project root.
  • Application data: a logical SQL export containing tables, rows, indexes, routines and (when included) triggers.

Do not copy a local database data directory into a differently packaged Ubuntu installation. XAMPP releases may ship MariaDB rather than MySQL, and data-file formats, service users and paths can differ. Export SQL and restore it through the database server running on Ubuntu instead.

1. Inventory the local installation before touching the VPS

Write down the details that the production server must reproduce. This prevents a late discovery that the application depends on an extension, rewrite rule or scheduled task that existed only on your workstation.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Record the stack and paths

  • XAMPP release and operating system.
  • PHP version, loaded extensions and relevant settings such as upload limits and memory limits.
  • Database engine and version, database name, database user and character set.
  • Project document root. Linux XAMPP installations are normally below /opt/lampp; Windows installations commonly place projects in an htdocs directory. Locate the actual project directory rather than assuming either path.
  • Apache rewrite rules, usually in .htaccess, and any custom virtual-host settings.
  • Upload, cache, session or generated-file directories that must exist and be writable.
  • Environment files and secrets, mail-server settings, base URLs and filesystem paths.
  • Cron jobs, queue workers or other tasks that run outside a browser request.

Check compatibility risks

Compare the local PHP version with the PHP versions available in the Ubuntu LTS image you intend to use. A newer or older interpreter can expose deprecated functions, stricter typing, changed default settings or missing extensions. List every extension the application actually loads, such as database drivers, image processing, XML, multibyte strings or archive support, and plan to install the matching Ubuntu packages.

Also check assumptions that Windows often hides: Linux paths are case-sensitive, Apache may use a different user, and a URL that worked through XAMPP’s default host may require an explicit virtual host on Ubuntu.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Freeze the site and create rollback copies

If the local site receives changing data, put it in maintenance mode or stop writes while making the final export. A static site can be copied without a freeze, but a database that changes during export can leave files and rows out of sync.

Copy the application

Make an untouched archive or duplicate of the complete project, including uploads and configuration templates. Keep development-only material separate so it is not accidentally deployed: local caches, test fixtures, IDE directories, logs, and secrets intended only for your workstation should not be sent to a public server.

Export a portable SQL dump

From a machine with the database client, create a logical dump. Ubuntu documents the standard pattern:

mysqldump -u <database-user> -p <database-name> > site.sql

Enter the password when prompted and store the resulting file outside the web root. For a large or busy production database, physical backup tools can reduce downtime, but a logical dump is portable and straightforward to inspect and restore during this migration. Whatever method you choose, perform a test restore before cutover.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

XAMPP’s bundled backup feature is described by Apache Friends as still under development. An independently stored SQL dump plus the original project copy gives you a clearer recovery path.

3. Provision and secure the Ubuntu VPS

Choose a supported Ubuntu LTS image from your VPS provider. The exact package names and PHP versions vary by LTS release, so use the release’s repositories and adapt commands to that version.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
  1. Apply updates. Log in with the provider’s initial account and run sudo apt update && sudo apt upgrade.
  2. Create an administrative account. Create a non-root user, add it to the administrative group and test a second SSH session before disabling direct root login.
  3. Install an SSH key. Add your public key to the new account and prefer key authentication over password-only access.
  4. Configure the firewall. Allow SSH and the web ports only. A typical UFW sequence is sudo ufw allow OpenSSH, sudo ufw allow 'Apache Full', followed by sudo ufw enable. Restrict SSH to a trusted source range when your operating model permits it.
  5. Plan backups and snapshots. Enable the provider’s snapshot or backup service if available, and keep a copy of the SQL dump and configuration outside the VPS.

Do not publish the site until the firewall, administrative access and recovery copies are in place. Ubuntu’s server documentation covers package management, Apache, database administration, DNS and security; consult the instructions for the particular LTS release you installed.

4. Recreate Apache, PHP and the database runtime

Install Apache

Install the distribution Apache package and verify that it starts:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo apt install apache2
sudo systemctl enable --now apache2
sudo systemctl status apache2

The default page should be reachable at the VPS IP address before you add your own site.

Install PHP and required extensions

Install the PHP version compatible with the application and every extension identified during inventory. A minimal example for a repository-provided PHP build is:

sudo apt install php php-cli libapache2-mod-php php-mysql

Add application-specific packages rather than assuming this list is complete. Confirm the running version with php -v and inspect loaded modules with php -m. Match server-level limits to the application, especially upload size, execution time, memory and any PHP-FPM pool settings if you deploy PHP through FPM instead of Apache’s module.

Install MySQL or MariaDB-compatible packages

Ubuntu can run MySQL or a MariaDB-compatible server. Select one supported by the application, enable it as a service and apply its security configuration. The database service must be running before you create the application database and import the dump.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not expect the VPS to have the same root authentication method as XAMPP. Use the Ubuntu package’s administrative workflow, create a dedicated application user and grant only the privileges that application needs.

5. Transfer the project files safely

Create a destination outside temporary directories, commonly under /var/www/, and copy files over authenticated SSH. rsync preserves directory structure and can resume an interrupted transfer:

Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
rsync -avz --exclude '.git' --exclude 'node_modules' --exclude 'cache' ./ <admin-user>@<server-ip>:/var/www/<site-directory>/

Run the command from the project root and adjust exclusions to your application. Do not exclude uploads or other runtime data that the site needs.

Set ownership and write permissions

Apache must read the application code and write only to directories that genuinely require it. One common arrangement is to own deployable files by your administrative user and grant the web-server group access to upload and cache directories. The exact account name differs by distribution and PHP setup, so verify it with the running service rather than copying a permission recipe blindly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo chown -R <deploy-user>:<web-group> /var/www/<site-directory>
sudo find /var/www/<site-directory> -type d -exec chmod 755 {} ;
sudo find /var/www/<site-directory> -type f -exec chmod 644 {} ;
sudo chmod -R 775 /var/www/<site-directory>/<writable-directory>

Replace the writable-directory value with the specific upload, cache or storage path your application documents. Avoid making the entire document root writable or using unrestricted permissions.

6. Create an Apache virtual host

Apache2 treats sites as separate configuration files. Create a file such as /etc/apache2/sites-available/<domain>.conf with the real hostname and document root:

<VirtualHost *:80>
    ServerName <your-domain.example>
    ServerAlias www.<your-domain.example>
    DocumentRoot /var/www/<site-directory>

    <Directory /var/www/<site-directory>>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/<domain>-error.log
    CustomLog ${APACHE_LOG_DIR}/<domain>-access.log combined
</VirtualHost>

Use AllowOverride All only when the application needs .htaccess rules; otherwise, put required rules directly in the virtual-host configuration. Enable rewrite support when pretty URLs depend on it, enable the site, and reload Apache:

sudo a2enmod rewrite
sudo a2ensite <domain>.conf
sudo a2dissite 000-default.conf
sudo apache2ctl configtest
sudo systemctl reload apache2

Disabling the default site is appropriate when this VPS serves your application as its primary site. Keep it enabled if you intentionally host multiple sites and have configured them separately. Never reload after editing a configuration without running apache2ctl configtest; a syntax error can prevent Apache from loading the new configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

7. Create the database and restore the dump

Create an isolated database and user

Connect through the server’s administrative interface and create a database with the required character set, then create a user restricted to that database. Use a long, unique password and store it in the application’s protected environment configuration, not in a publicly readable file.

CREATE DATABASE <database-name> CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER '<database-user>'@'localhost' IDENTIFIED BY '<strong-password>';
GRANT ALL PRIVILEGES ON <database-name>.* TO '<database-user>'@'localhost';
FLUSH PRIVILEGES;

Run these statements through the database administrator account appropriate to your Ubuntu package. Restricting the account to localhost avoids exposing the database service to the network when the web application is on the same VPS.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Import the SQL file

mysql -u <database-user> -p <database-name> < site.sql

For a dump that contains its own database statements, follow the dump’s documented restore procedure instead. Check the import output for errors, then inspect row counts or run an application query so you know the restore produced usable data rather than merely completing a command.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

8. Update application configuration for Ubuntu

Change every value that referred to your workstation or XAMPP:

  • Database host, database name, username and password.
  • Base URL and trusted host names.
  • Absolute filesystem paths, including upload and cache locations.
  • Mail transport, sender address and credentials.
  • Session, queue and external-service environment variables.
  • PHP or framework settings that control uploads, URL rewriting and error display.

Keep secrets outside the document root and make production error responses generic. Check capitalization in every path and filename: a path that worked on a case-insensitive local filesystem can fail on Linux. Clear application caches after changing configuration, but do not delete user uploads.

9. Test the VPS privately before changing DNS

Use the VPS IP address or a temporary hosts-file entry that maps your real domain to the VPS. This lets you exercise the production stack while public DNS still points to the old site.

Functional test checklist

  • Homepage and every important navigation path.
  • Login, logout, password reset and authorization boundaries.
  • Database reads, inserts, updates and transactions.
  • Forms, validation, file uploads and generated downloads.
  • Images, CSS, JavaScript and paths containing uppercase characters.
  • Pretty URLs, redirects and 404 handling.
  • Email delivery, queue workers and cron jobs.
  • Large uploads and any endpoint that approaches PHP or proxy limits.
  • Production error handling with debug output disabled.

Inspect services and logs

sudo systemctl status apache2
sudo systemctl status mysql
sudo journalctl -u mysql
sudo tail -f /var/log/apache2/<domain>-error.log

Use the service status and logs to distinguish an Apache configuration problem from a PHP fatal error, database authentication failure or filesystem permission denial. Fix issues while the old site remains available, then repeat the tests after each significant change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

10. Cut over DNS and enable HTTPS

Lower the domain’s DNS TTL before the planned change when your DNS provider permits it. At cutover, point the required A or AAAA records to the VPS address and leave the old site intact while resolvers update.

Issue or re-issue a TLS certificate for every hostname you serve, using an ACME client supported by your Ubuntu release or VPS workflow. Configure HTTP-to-HTTPS redirection, confirm that the certificate covers the canonical hostname and its chosen alias, and update the application’s base URL so generated links use HTTPS. Test cookies, mixed-content warnings, webhooks and any API clients after the redirect is active.

DNS propagation is not instantaneous. For a period, some visitors may reach the old server and others the VPS, so keep both copies consistent or place the old site in read-only mode during the transition.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

11. Keep a deliberate rollback plan

Document the reversal procedure before cutover: the previous DNS records, the old site’s location, the verified SQL dump, configuration backups and the person authorized to make the change. Retain the local XAMPP project and database export until traffic, logs and backups remain healthy through the observation window you selected.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If the VPS fails after DNS changes, restore the previous DNS records, stop writes on the partially migrated site if necessary, and investigate using the VPS logs. Do not delete the source copy immediately after the first successful page load; a latent cron, upload or database issue may appear only after real traffic arrives.

Common failure modes and fixes

The domain shows Apache’s default page

Confirm that the DNS record points to the VPS, the virtual host’s ServerName matches the requested hostname, the site is enabled and Apache was reloaded after a successful configuration test. Remove or disable the default site only when it is not needed for another host.

PHP code downloads or appears as text

PHP is not being handled by the configured Apache module or PHP-FPM pool. Verify the PHP package, handler configuration and Apache error log, then reload the service after correcting it.

Database connection errors

Check the database service status, database name, username, password and host value. A local XAMPP account may have used a blank password or a different authentication plugin; create a dedicated Ubuntu account and update the application instead of copying that assumption.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

404 errors on pretty URLs

Enable the rewrite module, permit the application’s .htaccess rules in the virtual host, verify that the file arrived in the document root and reload Apache. Also confirm that the framework’s base URL matches the public hostname.

Uploads fail with permission or size errors

Give the web-server account write access only to the intended upload directory, and raise PHP or proxy upload limits consistently if the application requires larger files. Check the PHP configuration actually used by web requests rather than relying only on the command-line version.

Images or includes fail only on Ubuntu

Look for case mismatches in filenames and paths, Windows drive letters, backslashes and hard-coded XAMPP directories. Replace them with Linux paths or application-relative paths and verify ownership of every generated directory.

How to choose the VPS and backup setup

There is no universal CPU, memory or storage figure for this migration. Requirements depend on traffic, PHP workload, database size, background jobs and provider limits. Evaluate infrastructure using these concrete criteria:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Decision factor What to verify
Ubuntu support A supported Ubuntu LTS image and a documented upgrade path.
Backups Automated off-site backups, point-in-time options or snapshots, plus a clear restore procedure.
Network location A region close to your users and the IPv4 or IPv6 connectivity your DNS plan requires.
Limits Bandwidth, storage, I/O and database resource limits that fit the application.
Security controls Provider firewall features, private networking and usable SSH-key management.
Operations Support quality, monitoring options and the total recurring cost rather than the headline VPS price.

For database backups, choose based on size and downtime tolerance. mysqldump is a portable logical option and is suitable for many small and medium migrations. Physical tools can be more appropriate for very large production databases, but they require compatibility checks and restore testing. Whichever method you select, keep at least one copy outside the VPS.

Final cutover checklist

  • The local project, uploads and a verified SQL dump are retained.
  • Ubuntu is updated, SSH keys work for a non-root administrator and the firewall exposes only required ports.
  • Apache, the compatible PHP version and all required extensions are installed and running.
  • The database and least-privilege application user exist, and the dump has been restored and checked.
  • Files are in the intended document root with restrictive code permissions and deliberate writable directories.
  • The virtual host uses the real hostname, correct document root, required rewrite behavior and valid logs.
  • Private tests cover authentication, database writes, uploads, URLs, mail, cron and error handling.
  • DNS records, TLS certificates, HTTPS redirects and canonical URLs are ready.
  • Rollback records, configuration backups and an observation window are documented.

Once these checks pass, DNS becomes the final routing change rather than a blind deployment step. The VPS is then running the same application behavior through independently managed Ubuntu services, with a tested path back to the original local copy if a production issue appears.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.