Percona XtraBackup for Windows

Percona XtraBackup for Windows

Percona XtraBackup for WindowsDon’t Try This at Home!

Disclaimer: The procedure described in this blog post is not officially supported by Percona XtraBackup. Use it under your responsibility. I tested and used it successfully, but your mileage may vary.

Note from the author: Wikipedia defines clickbait as text (or a link) that is designed to attract attention and to entice users to read that online content, with a defining characteristic of being deceptive. Maybe the headline of this post is a bit deceptive, as there is no Percona XtraBackup for Windows, but I hope you will not feel deceived after reading this blog post, I just felt that it was funny to use a clickbait-style while writing it.

He Couldn’t Believe it When He Read That Post!

Pep had to migrate a client database from Windows to Linux and was considering all the available options to move the database with the minimal downtime possible. He found this blog post, Running Percona XtraBackup on Windows … in Docker from Vadim Tkachenko that describes a procedure to backup a Windows database using Percona XtraBackup and Docker.

There is also the post Running XtraBackup on Windows using WSL, which describes a similar process using Windows Services for Linux.

Out of an old version, compiled using Cygwin, and an inactive effort to build a Windows version Percona XtraBackup 1.6 for Windows “try me” edition, the only way to use XtraBackup to copy a database running on Windows involved some sort of virtualization. Was it possible to use Percona XtraBackup without involving virtualization?

Datafiles Then And Now: How They’ve Changed!

To perform a backup, XtraBackup does a lot of different things.

It connects to the database and retrieves information about it, and executes commands that are required during the process.

Then it copies all the datafiles and InnoDB redo logs. As the contents of the datafiles change during the backup, the copy is inconsistent. This is why the contents of redo logs are copied also. They are used to turn the inconsistent backup copy into a consistent one during the “prepare” stage.

A detailed description of this process is beyond the scope of this post, you just need to know that XtraBackup needs logical access to the database and physical access to the database files. Feel free to look at the documentation or watch my recent Percona Live talks about Percona XtraBackup if you need more information:

Dr. XtraBackup or: How I Learned to Stop Worrying and Love Backups I
Dr. XtraBackup or: How I Learned to Stop Worrying and Love Backups II

This DBA Wanted to Make a Backup and Did The Most Incredible Thing!

Could we execute XtraBackup from a remote Linux box to perform a backup of a Windows database? Regarding the database connection, you don’t need to connect locally to the database to perform a backup, it can be done remotely.

Could we access the database files remotely? The answer is yes, of course. You just need to create network shares for the folders that contain the database files. And then mount them on Linux to execute the backup there.

This cute network share will melt your heart!

Usually, you need to share only the “datadir” but, if the database you want to backup has the redo log files located in a different directory, then you’ll need to share that directory also.

If binary logging is enabled, XtraBackup also needs access to the directory where binary logs are located. So, in the best case, you need to create only one network share, otherwise, you will need to share every directory that contains database files.

My recommendation is that you create the Windows shares with read-only permissions, to avoid writing to them by mistake.

Once you create the network shares, you need to mount them on the Linux box that will effectively run the backup, for example:

mount -t cifs -o vers=3.11,cache=none,actimeo=0,ro //<server>/<folder /<mount_point>

The filesystem type is CIFS. Use the highest version supported by your server. You should see something like this if you run the mount command without parameters:

//<server>/datadir on /winbox/datadir type cifs (ro,relatime,vers=3,cache=none,username=<username>,domain=<domain>,uid=0,noforceuid,gid=0,noforcegid,addr=<ip_address>,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=8388608,wsize=1048576,echo_interval=60,actimeo=0)

Check the mount options for the credential file and other parameters. Do not include the credentials in the mount command!

This is Why Configuration Parameters Exist!

Now we have access to the database, using database credentials. And we have access to the files, using the shared folders. But we need to tell XtraBackup how to access them.

To perform a backup you need a database user with the following privileges:

  • RELOAD and LOCK TABLES (unless the –no-lock option is specified) to be able to execute “FLUSH TABLES WITH READ LOCK” and “FLUSH ENGINE LOGS” before starting to copy the files.
  • LOCK TABLES FOR BACKUP and LOCK BINLOG FOR BACKUP are privileges required to use backup locks.
  • REPLICATION CLIENT to obtain the binary log position.
  • CREATE TABLESPACE to import tables.
  • PROCESS to run SHOW ENGINE INNODB STATUS and to see all the threads running on the server.
  • SUPER to start/stop the replica threads in a replication environment (optional), and create, delete and select privileges on the PERCONA_SCHEMA (if it exists) to store incremental and history data.

Usually, we tend to grant all privileges to the user that will connect to the database to run the backup.

You can tell XtraBackup how to connect to the database using these parameters:

--host=<ip_address or hostname>
--datadir=<local mount point for remote share>
--log-bin-index=<location of log-bin index file>
--log-bin=<local mount point for remote share>

For example:

xtrabackup --user=root --password=<password> --host= --backup --datadir=/mnt/data --log-bin-index=/mnt/data/binlog.index --log-bin=/mnt/data --target-dir=<dest_dir> --innodb_log_file_size=<log_file_size> --strict

Remember to always use the –strict option, this will make xtrabackup fail if you make a typo and a parameter is not specified properly. And if there is any relevant InnoDB parameter that has been modified, then you can add it also as a parameter to xtrabackup (–innodb_log_file_size in the example)

He Thought It Was Over, but It Was Not!

Once we have the backup stored in the Linux server, we can prepare it following the standard procedure:

xtrabackup --prepare --target-dir=<dest-dir>

But now that we have a backup prepared and stored in Linux, is it possible to start that database on Linux? Yes! It is possible!

You only need to make sure that the database starts with lower_case_table_names enabled as the database comes from a case-insensitive filesystem.

And, if you enable binary logging in the new server, you may need to manually edit the binlog index file to replace the \ by a / as this is the directory delimiter on Linux.

I hope you will be able to use this procedure successfully and, as always, test restoring your backups frequently!


Running Percona Monitoring and Management v2 on Windows with Docker

PMM Windows Docker

PMM Windows DockerOne way to run Percona Monitoring and Management (PMM) v2 on Windows is using the Virtual Appliance installation method. It works well but requires you to run extra software to run Virtual Appliances, such as Oracle VirtualBox, VMWare Workstation Player, etc. Or, you can use Docker.

Docker is not shipped with Windows 10, though you can get it installed for free with Docker Desktop. Modern Docker on Windows actually can either run using Hyper-V backend or using Windows Subsystem for Linux v2 (WSL2). Because WSL2-based Docker installation is more involved, I’m sticking to what is now referred to as “legacy” Hyper-V backend.

On my Windows 10 Pro (19042) system, I had to change some BIOS settings:


PMM on Windows Docker


And install the Hyper-V component for Docker Desktop to install correctly:


Percona Monitoring and Management Windows


With this, we’re good to go to install Percona Monitoring and Management on Windows.


Register for Percona Live ONLINE
A Virtual Event about Open Source Databases


Official installing PMM with Docker instructions assumes you’re running a Linux/Unix-based system that needs to be slightly modified for Windows. First, there is no sudo on Windows, and second, “Command Prompt” does not interpret “\”  the same way as shell does.

With those minor fixes though, basically, the same command to start PMM works:

docker pull percona/pmm-server:2
docker create --volume /srv --name pmm-data percona/pmm-server:2 /bin/true
docker run --detach --restart always --publish 80:80 --publish 443:443 --volumes-from pmm-data --name pmm-server percona/pmm-server:2

That’s it! You should have your Percona Monitoring and Management (PMM) v2 running!

Looking at PMM Server Instance through PMM itself you may notice it does not have all resources by default, as Docker on Linux would.




Note there are only 2 CPU cores, 2GB of Memory, and some 60GB of Disk space available.  This should be enough for a test but if you want to put some real load on this instance you may want to adjust those settings. It is done through the “Resources” setting in Docker Desktop:




Adjust these to suit your load needs and you’re done!  Enjoy your Percona Monitoring and Management!


Microsoft brings new robotic process automation features to its Power Platform

Earlier this year, Microsoft acquired Softomotive, a player in the low-code robotic process automation space with a focus on Windows. Today, at its Ignite conference, the company is launching Power Automate Desktop, a new application based on Softomotive’s technology that lets anyone automate desktop workflows without needing to program.

“The big idea of Power Platform is that we want to go make it so development is accessible to everybody,” Charles Lamanna, Microsoft’s corporate VP for its low-code platform, told me. “And development includes understanding and reporting on your data with Power BI, building web and mobile applications with Power Apps, automating your tasks — whether it’s through robotic process automation or workflow automation — with Power Automate, or building chatbots and chat-based experiences with Power Virtual Agent.”

Power Automate already allowed users to connect web-based applications, similar to Zapier and IFTTT, but the company also launched a browser extension late last year to help users connect native system components to Power Automate. Now, with the integration of the Softomotive technology and the launch of this new low-code Windows application, it’s taking this integration into the native Windows user interface one step further.

“Everything still runs in the cloud and still connects to the cloud, but you now have a rich desktop application to author and record your UI automations,” Lamanna explained. He likened it to an “ultimate connector,” noting that the “ultimate API is just the UI.”

He also stressed that the new app feels like any other modern Office app, like Outlook (which is getting a new Mac version today, by the way) or Word. And like the modern versions of those apps, Power Automate Desktop derives a lot of its power from being connected to the cloud.

It’s also worth noting that Power Automate isn’t just a platform for automating simple two or three-step processes (like sending you a text message when your boss emails you), but also for multistep, business-critical workflows. T-Mobile, for example, is using the platform to automate some of the integration processes between its systems and Sprint.

Lamanna noted that for some large enterprises, adopting these kinds of low-code services necessitates a bit of a culture shift. IT still needs to have some insights into how these tools are used, after all, to ensure that data is kept safe, for example.

Another new feature the company announced today is an integration between the Power Platform and GitHub, which is now in public preview. The idea here is to give developers the ability to create their own software lifecycle workflows. “One of the core ideas of Power Platform is that it’s low code,” Lamanna said. “So it’s built first for business users, business analysts, not the classical developers. But pro devs are welcome. The saying I have is: we’re throwing a party for business users, but pro devs are also invited to the party.” But to get them onto the platform, the team wants to meet them where they are and let them use the tools they already use — and that’s GitHub (and Visual Studio and Visual Studio Code).


Microsoft launches a new app to make using Office easier

Microsoft today announced a new Office app that’s now available to Windows Insiders and that will soon roll out to all Windows 10 users. The new Office app will replace the existing My Office app (yeah, those names…). While the existing app was mostly about managing Office 365 subscriptions, the new app provides significantly more features and will essentially become the central hub for Office users to switch between apps, see their pinned documents and access other Office features.

The company notes that this launch is part of its efforts to make using Office easier and help users “get the most out of Office and getting them back into their work quickly.” For many Office users, Outlook, Word, PowerPoint and Excel are basically their central tools for getting work done, so it makes sense to give them a single app that combines in a single place all the information about their work.

Using the app, users can switch between apps, see everything they’ve been working on, as well as recommended documents based on what I assume is data from the Microsoft Graph. There’s also an integrated search feature and admins will be able to customize the app with other line of business applications and their company’s branding.

The app is free and will be available in the oft-forgotten Microsoft Store. It’ll work for all users with Office 365 subscriptions or access to Office 2019, Office 2016 or Office Online.


AWS tries to lure Windows users with Amazon FSx for Windows File Server

Amazon has had storage options for Linux file servers for some time, but it recognizes that a number of companies still use Windows file servers, and they are not content to cede that market to Microsoft. Today the company announced Amazon FSx for Windows File Server to provide a fully compatible Windows option.

“You get a native Windows file system backed by fully-managed Windows file servers, accessible via the widely adopted SMB (Server Message Block) protocol. Built on SSD storage, Amazon FSx for Windows File Server delivers the throughput, IOPS, and consistent sub-millisecond performance that you (and your Windows applications) expect,” AWS’s Jeff Barr wrote in a blog post introducing the new feature.

That means if you use this service, you have a first-class Windows system with all of the compatibility with Windows services that you would expect, such as Active Directory and Windows Explorer.

AWS CEO Andy Jassy introduced the new feature today at AWS re:Invent, the company’s customer conference going on in Las Vegas this week. He said that even though Windows File Server usage is diminishing as more IT pros turn to Linux, there are still a fair number of customers who want a Windows-compatible system and they wanted to provide a service for them to move their Windows files to the cloud.

Of course, it doesn’t hurt that it provides a path for Microsoft customers to use AWS instead of turning to Azure for these workloads. Companies undertaking a multi-cloud strategy should like having a fully compatible option.

more AWS re:Invent 2018 coverage


Microsoft to shut down Wunderlist in favor of its new app, To-Do

 Microsoft acquired the popular mobile to do list application Wunderlist back in 2015, and now it’s preparing users for its eventual demise with the release of its new application “To-Do,” announced today. The new app was built by the team behind Wunderlist, and will bring in the favorite elements of that app in the months ahead, Microsoft says. The company also added that… Read More


Running Percona XtraDB Cluster on Windows … in Docker

Percona XtraDB Cluster

Percona XtraDB ClusterIn this blog post, we’ll look at how to run Percona XtraDB Cluster on Windows using Docker.

This is a follow-up to my previous post on Percona XtraBackup on Windows. The fact is that with Docker you can now run a variety of software applications on Windows that previously were available only for Linux platforms.

We can run (to evaluate and for testing purposes) several nodes of Percona XtraDB Cluster on a single Windows box.

The steps for this are:

  1. Setup Docker on the Windows box.
  2. Create a Docker network.
    docker network create net1
  3. Bootstrap the cluster.
    docker run -e MYSQL_ROOT_PASSWORD=test -e CLUSTER_NAME=cl1 --name=node1 --net=net1 perconalab/percona-xtradb-cluster
  4. Join the nodes.
    docker run -e MYSQL_ROOT_PASSWORD=test -e CLUSTER_NAME=cl1 -e CLUSTER_JOIN=node1 --net=net1 perconalab/percona-xtradb-cluster

Repeat step 4 as many times as you want.

The result: the cluster is now running on Windows!


Running Percona XtraBackup on Windows … in Docker

Percona XtraBackup

Percona XtraBackupIn this blog, we’ll look at running Percona XtraBackup on Windows via a Docker container.

The question whether Percona XtraBackup is available for Windows comes up every so often. While we are not planning to provide regular releases for Windows, I decided to share a way to run Percona XtraBackup in a Docker container (especially since Docker support for Windows has become more and more stable).

For this exercise, I created a playground Docker image: perconalab/percona-xtrabackup.

First, we need to prepare a few things to make it work:

  1. Install Docker on Windows (the current version I am running is 17.03)
  2. Enable the sharing of disk C in Docker settings
  3. Find out the IP address MySQL is running on ( in my case)
  4. Grant backup-required privileges for the xtrabackup user:


Now, let’s assume our datadir is in C:/mysqldata, and we want to backup to C:/mysqlbackup. Needless to say, that XtraBackup image must run on the same server as MySQL’s datadir (since XtraBackup needs to access the data to copy it).

Now to take a backup we execute:

docker run --rm -it -v //C/mysqldata:/var/lib/mysql -v //C/mysqlbackup:/xtrabackup_backupfiles perconalab/percona-xtrabackup --backup --host= --user=xtrabackup --password=xtrapassword

We find our backup in C:/mysqlbackup when it is done.



Google Cloud takes aim at Microsoft customers with new Windows VMs

disrupt_sf16_diane_greene-3758 Google announced several new products today aimed at luring IT pros who are using Windows in their data centers to the Google Cloud Platform. With that in mind, Google introduced support for Microsoft SQL Server Enterprise and Windows Server Core on the Cloud Platform. In addition, the company announced support for SQL Server Always-On Availability Group for customers who are concerned about… Read More


Windows Server 2016 will come with commercial support for Docker Engine

docker_whale_dockerconeu Microsoft loves to talk about how we are now living in a “cloud first, mobile first” world, but in this world, there is still plenty of room left for Windows Server. Today, at its Ignite conference in Atlanta, the company announced that Windows Server 2016 will be available for purchase on October 1 and will then ship in mid-October. That’s pretty much in line with… Read More

Powered by WordPress | Theme: Aeros 2.0 by TheBuckmaker.com