Skip to content

Fully automated phpMyAdmin updater — safely downloads, extracts, backs up and upgrades phpMyAdmin installations. Internal use project. External contributions not accepted. Use as-is or fork.

License

Notifications You must be signed in to change notification settings

jsas4coding/pma-up

Repository files navigation

phpMyAdmin Updater (pma-up)

CI Go Version License: MIT GitHub release (latest by tag) codecov

phpMyAdmin Updater — CLI tool for fully automated phpMyAdmin updates

This project automates the full update process of a phpMyAdmin installation, downloading the latest release, safely replacing the current installation, preserving configuration files, and creating backups.

Project Notice This repository is primarily for personal/internal use. Pull Requests and Issues from external contributors are not being accepted. Feel free to use it as-is or fork for your own usage.


Features

  • Automatically fetches the latest phpMyAdmin release.
  • Verifies version file directly from phpMyAdmin servers.
  • Downloads and extracts the latest zip archive.
  • Backs up existing installation before upgrade.
  • Preserves your existing config.inc.php file.
  • Fully automated with detailed logging.
  • Built with paranoid error checking.
  • Designed for cron-based unattended updates.

Installation

1️⃣ Download prebuilt binary

Prebuilt releases are available at: GitHub Releases

Choose the binary appropriate for your platform, and place it somewhere in your $PATH.

Example (Linux amd64):

wget https://github.com/jsas4coding/pma-up/releases/download/vX.Y.Z/pma-up_X.Y.Z_linux_amd64.tar.gz
tar -xzf pma-up_X.Y.Z_linux_amd64.tar.gz
sudo mv pma-up /usr/local/bin/

2️⃣ Build locally (optional)

If you prefer to build from source:

git clone https://github.com/jsas4coding/pma-up.git
cd pma-up
make build

This will generate a local pma-up binary.


Usage

pma-up <phpmyadmin_path> <config_file_path>

Example:

pma-up /var/www/html/phpmyadmin /path/to/config.inc.php

The tool will:

  • Create a backup directory with timestamp: /var/www/html/phpmyadmin_backup_YYYYMMDDHHMMSS
  • Download the latest release.
  • Extract and replace safely.
  • Restore your existing config.inc.php.

Automating with crontab

To schedule periodic updates automatically:

crontab -e

Add a line similar to:

0 3 * * 0 /usr/local/bin/pma-up /var/www/html/phpmyadmin /path/to/config.inc.php >> /var/log/pma-up.log 2>&1
  • Runs every Sunday at 3AM.
  • Logs output to /var/log/pma-up.log.

✅ Always verify functionality manually before automating.


Testing

You can run full tests locally:

make test     # Unit tests
make e2e      # End-to-end tests
make lint     # Linter check

Test Coverage Philosophy

The phpMyAdmin Updater project applies paranoid-grade testing strategy:

  • ✅ Functional flows fully tested.
  • ✅ Error handling fully validated.
  • ✅ Full linter compliance (golangci-lint clean).
  • ✅ Coverage reports currently show ~65%-70% due to inherent Go tooling limitations.

Why is coverage not 100%?

The following conditions in Go are technically difficult to cover via tests:

  • defer Close() errors are nearly impossible to force under normal conditions.
  • file.Open() failures cannot be simulated easily without dependency injection.
  • scanner.Err() in bufio.Scanner requires custom Reader injection not feasible in pure unit tests.
  • These code paths remain safe but untriggered.

We prefer honest functional coverage rather than artificially inflating coverage via aggressive mocking.

Coverage Visualization

Coverage Sunburst

You can explore the current detailed coverage report here.

Reference


License

This project is licensed under the MIT License.

It is provided "as is", without warranty of any kind.

The repository is public, but not actively maintained as a community-driven project.

Use at your own risk and discretion.

About

Fully automated phpMyAdmin updater — safely downloads, extracts, backs up and upgrades phpMyAdmin installations. Internal use project. External contributions not accepted. Use as-is or fork.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •