PHPackages                             imafaz/netback - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. imafaz/netback

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

imafaz/netback
==============

lightweight library for backup and restore vpn servers

1.0.0(1y ago)04MITPHP

Since Nov 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/AfazTech/NetBack)[ Packagist](https://packagist.org/packages/imafaz/netback)[ Docs](https://github.com/imafaz/NetBack)[ RSS](/packages/imafaz-netback/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

NetBack
=======

[](#netback)

NetBack is a PHP library designed for backing up and restoring data from network devices and applications. It provides an easy-to-use interface for managing backups across various platforms, including IBSng, Mikrotik, and xui.

---

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [Example](#examples)
- [Available Methods](#available-methods)
- [Todo](#todo)
- [License](#license)

---

Features
--------

[](#features)

- Backup and restore functionality for network devices.
- Support for multiple device types: IBSng, Mikrotik, and xui.
- Logging capabilities to track backup operations.

Requirements
------------

[](#requirements)

- PHP 7.4 or higher
- Composer
- phpseclib3 library
- EasyLog library

Installation
------------

[](#installation)

You can install NetBack using Composer. Run the following command in your terminal:

```
composer require imafaz/netback
```

Usage
-----

[](#usage)

To use the NetBack library, you need to create instances of the classes corresponding to the devices you want to back up. Below are examples of how to use each class.

### Examples

[](#examples)

#### Example for IBSng

[](#example-for-ibsng)

```
require __DIR__ . '/vendor/autoload.php';

use NetBack\IBSng;

$ibsng = new IBSng('IBSngDevice', '192.168.1.1', 'username', 'password', 22);
$ibsng->backup('/path/to/local/backup.sql');
```

#### Example for Mikrotik

[](#example-for-mikrotik)

```
require __DIR__ . '/vendor/autoload.php';

use NetBack\Mikrotik;

$mikrotik = new Mikrotik('MikrotikDevice', '192.168.1.2', 'username', 'password', 22);
$mikrotik->backup('backupName', '/path/to/local/backup.backup');
```

#### Example for xui

[](#example-for-xui)

```
require __DIR__ . '/vendor/autoload.php';

use NetBack\xui;

$xui = new xui('xuiDevice', '192.168.1.3', 'username', 'password', 22);
$xui->backup('/path/to/local/xui.db');
```

Available Methods
-----------------

[](#available-methods)

### IBSng

[](#ibsng)

### `__construct`

[](#__construct)

#### Description:

[](#description)

Initializes the IBSng object with connection parameters.

#### Signature:

[](#signature)

```
$ibsng = new IBSng(string $name, string $ip, string $username, string $password, int $port);
```

#### Attributes:

[](#attributes)

AttributeDescriptionTypeRequiredDefault$nameName of the IBSng devicestringYes-$ipIP address of the devicestringYes-$usernameUsername for authenticationstringYes-$passwordPassword for authenticationstringYes-$portPort for SSH connectionintYes22---

### `backup`

[](#backup)

#### Description:

[](#description-1)

Performs a backup of the IBSng database.

#### Signature:

[](#signature-1)

```
$ibsng->backup(string $localPath);
```

#### Attributes:

[](#attributes-1)

AttributeDescriptionTypeRequiredDefault$localPathPath to save the backup filestringYes----

### Mikrotik

[](#mikrotik)

### `__construct`

[](#__construct-1)

#### Description:

[](#description-2)

Initializes the Mikrotik object with connection parameters.

#### Signature:

[](#signature-2)

```
$mikrotik = new Mikrotik(string $name, string $ip, string $username, string $password, int $port);
```

#### Attributes:

[](#attributes-2)

AttributeDescriptionTypeRequiredDefault$nameName of the Mikrotik devicestringYes-$ipIP address of the devicestringYes-$usernameUsername for authenticationstringYes-$passwordPassword for authenticationstringYes-$portPort for SSH connectionintYes22---

### `backup`

[](#backup-1)

#### Description:

[](#description-3)

Creates a backup of the Mikrotik device.

#### Signature:

[](#signature-3)

```
$mikrotik->backup(string $backupName, string $localPath);
```

#### Attributes:

[](#attributes-3)

AttributeDescriptionTypeRequiredDefault$backupNameName of the backup filestringYes-$localPathPath to save the backup filestringYes----

### xui

[](#xui)

### `__construct`

[](#__construct-2)

#### Description:

[](#description-4)

Initializes the xui object with connection parameters.

#### Signature:

[](#signature-4)

```
$xui = new xui(string $name, string $ip, string $username, string $password, int $port);
```

#### Attributes:

[](#attributes-4)

AttributeDescriptionTypeRequiredDefault$nameName of the xui devicestringYes-$ipIP address of the devicestringYes-$usernameUsername for authenticationstringYes-$passwordPassword for authenticationstringYes-$portPort for SSH connectionintYes22---

### `backup`

[](#backup-2)

#### Description:

[](#description-5)

Downloads the xui database file.

#### Signature:

[](#signature-5)

```
$xui->backup(string $localPath);
```

#### Attributes:

[](#attributes-5)

AttributeDescriptionTypeRequiredDefault$localPathPath to save the database filestringYes----

Todo
----

[](#todo)

- add restore method
- add other devices support

---

License
-------

[](#license)

This project is licensed under the MIT License. See the [LICENSE](https://github.com/imafaz/NetBack/blob/main/LICENSE) file for details.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

549d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/69a193cfdda61e7981d7ed0d451533a35edf52421f0d4f8c789d715a6d160a9b?d=identicon)[afaztech](/maintainers/afaztech)

---

Top Contributors

[![AfazTech](https://avatars.githubusercontent.com/u/106348299?v=4)](https://github.com/AfazTech "AfazTech (3 commits)")

---

Tags

NetBacknet backupvpn server backup restorex-ui backup and restoremikrotik backup and restoreibsng backup and restore

### Embed Badge

![Health badge](/badges/imafaz-netback/health.svg)

```
[![Health](https://phpackages.com/badges/imafaz-netback/health.svg)](https://phpackages.com/packages/imafaz-netback)
```

###  Alternatives

[jenssegers/optimus

Id obfuscation based on Knuth's integer hash method

1.3k4.8M27](/packages/jenssegers-optimus)[pocketmine/pocketmine-mp

A server software for Minecraft: Bedrock Edition written in PHP

3.5k74.6k86](/packages/pocketmine-pocketmine-mp)[phpseclib/mcrypt_compat

PHP 5.x-8.x polyfill for mcrypt extension

28029.7M34](/packages/phpseclib-mcrypt-compat)[godruoyi/php-snowflake

An ID Generator for PHP based on Snowflake Algorithm (Twitter announced).

8582.3M61](/packages/godruoyi-php-snowflake)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[phpseclib/bcmath_compat

PHP 5.x-8.x polyfill for bcmath extension

16720.7M17](/packages/phpseclib-bcmath-compat)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
