Operating system migration method and computing device

By deleting the relevant information of the target software package from the target database before the operating system is migrated, and installing compatible dependency packages on the new operating system, the software package compatibility problem in operating system migration is solved, and the normal migration of the operating system and the normal operation of the software package is achieved.

CN117608653BActive Publication Date: 2025-04-08XFUSION DIGITAL TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311348302.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-17
Publication Date
2025-04-08
Estimated Expiration
2043-10-17

AI Technical Summary

Technical Problem

During the operating system migration process, users want to keep some business packages without upgrading, but these packages may have compatibility issues on the new operating system, resulting in the migration failure.

Method used

By deleting the relevant information of the target software package in the target database, the operating system ignores the software package during the migration process, avoiding compatibility issues. Then, install the compatible dependency package on the new operating system to ensure that the target package works properly.

Benefits of technology

The normal migration of the operating system is realized, which avoids migration failures caused by compatibility issues, and ensures that the target software package is running normally on the new operating system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117608653B_ABST
    Figure CN117608653B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides an operating system migration method and computing device, which relates to the field of server technology, and can avoid compatibility issues of software packages, so that the operating system can complete the migration normally. The method includes: determining a target software package in a first operating system; the target software package is a software package that is not upgraded and incompatible with the first operating system during the migration to the second operating system; deleting relevant information of the target software package from a target database; the target database is used to record relevant information of each software package in the first operating system before and after the migration of the first operating system; based on the target database, migrating the first operating system to the second operating system; installing a compatible dependency package on the second operating system; the compatible dependency package is used to support the target software package to run on the second operating system. The embodiment of the present application can be used in the operation and maintenance process of computing equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of server technology, and more particularly to an operating system migration method and a computing device. Background Art

[0002] As operating systems are updated and upgraded, the original operating systems may have vulnerabilities or security issues. Enterprises need to migrate the operating systems to ensure the security and operational stability of business applications on the operating systems.

[0003] In the scenario of operating system migration, users often hope to keep the existing services stable, that is, they hope that the software packages of some services will not be upgraded along with the operating system migration. However, the retained software packages may have compatibility issues on the new operating system, resulting in the failure of the operating system migration to complete normally. Summary of the invention

[0004] The embodiments of the present application provide an operating system migration method and a computing device, which can avoid compatibility issues of software packages and enable the operating system to complete migration normally.

[0005] In a first aspect, an embodiment of the present application provides an operating system migration method, the method comprising: determining a target software package in a first operating system; wherein the target software package is a software package that is not upgraded and is incompatible with the first operating system during migration to a second operating system; deleting relevant information of the target software package from a target database; the target database is used to record relevant information of each software package in the first operating system before and after migration of the first operating system; based on the target database, migrating the first operating system to the second operating system; installing a compatible dependency package on the second operating system; the compatible dependency package is used to support the target software package to run compatibly on the second operating system.

[0006] The embodiment of the present application provides an operating system migration method, which deletes the relevant information of the target software package from the target database before the operating system is migrated. Since the migration of the operating system is based on the record of the software package in the target database, the operating system will think that the target software package is not installed, and will not process the target software package during the migration process. In this way, the operating system will not report an error due to the compatibility problem of the target software package during the migration process, so that the operating system can complete the migration normally. Finally, the compatible dependency package is installed on the migrated operating system to ensure that the target software package can run normally on the new operating system.

[0007] In a possible implementation, determining the target software package in the first operating system includes: obtaining the software package to be retained; determining the dependent packages of the software package to be retained; the dependent packages are software packages that support the software package to be retained to run on the first operating system; determining whether there is a version conflict in the dependent package on the second operating system; the version conflict is used to indicate that different versions of the dependent package exist in the second operating system; in the case of a version conflict, determining the software package to be retained as the target software package. It can be understood that for the software packages that the user needs to retain, only the software packages to be retained with compatibility issues are selected for subsequent processing, which can effectively improve the migration efficiency of the operating system.

[0008] In another possible implementation, before installing the compatible dependency package on the second operating system, the method further includes: obtaining a compatible dependency package corresponding to the target software package from a compatible dependency package set according to the identifier of the target software package; the compatible dependency package set includes software packages that support the running of the non-upgraded software package on the second operating system. It can be understood that directly querying and obtaining the compatible dependency package from the pre-configured compatible dependency package set and installing it can greatly improve the migration efficiency.

[0009] In another possible implementation, before installing the compatible dependency package on the second operating system, the method further includes: obtaining a compatible dependency package corresponding to the target software package from a compatible dependency package set according to the identifier of the target software package; the compatible dependency package set includes software packages that support the non-upgraded software package to run on the second operating system. It can be understood that by changing the package name of the dependency package, the corresponding compatible dependency package can be directly obtained, which is applicable to any type of software package and can effectively improve the versatility of the operating system migration method.

[0010] In another possible implementation, before deleting the relevant information of the target software package from the target database, the method further includes: obtaining the relevant information of the target software package from the target database; and backing up the relevant information of the target software package to a storage space. It is understandable that backing up the relevant information can avoid data loss and facilitate subsequent data recovery.

[0011] In another possible implementation, after migrating the first operating system to the second operating system, the method further includes: obtaining relevant information of the target software package from the storage space; and updating the relevant information of the target software package to the target database. It is understandable that after the data is restored, the relevant information of the target software package is re-recorded in the target database, so that the user can conveniently maintain the target software package in the subsequent use of the new operating system.

[0012] In yet another possible implementation, the method further includes: updating the dependency relationship between the target software package and the compatible dependent package into the relevant information of the target software package in the target database.

[0013] In yet another possible implementation, the target database is an Rpm database.

[0014] In yet another possible implementation, the method further includes: during the process of migrating the first operating system to the second operating system, backing up a predetermined directory in the first operating system.

[0015] In a second aspect, an embodiment of the present application provides an operating system migration device, which includes: a determination module, a deletion module, a migration module, and an installation module. The determination module is used to determine a target software package in a first operating system; wherein the target software package is a software package that is not upgraded and is incompatible with the first operating system during the migration to the second operating system; the deletion module is used to delete relevant information of the target software package from a target database; the target database is used to record relevant information of each software package in the first operating system before and after the migration of the first operating system; the migration module is used to migrate the first operating system to the second operating system based on the target database; the installation module is used to install a compatible dependency package on the second operating system; the compatible dependency package is used to support the target software package to run compatibly on the second operating system.

[0016] In a possible implementation, the determination module is specifically used to obtain a software package to be retained; determine a dependent package of the software package to be retained; the dependent package is a software package that supports the software package to be retained to run on the first operating system; determine whether there is a version conflict in the dependent package on the second operating system; the version conflict is used to indicate that different versions of the dependent package exist in the second operating system; if there is a version conflict, determine that the software package to be retained is a target software package.

[0017] In another possible implementation, the device further includes: an acquisition module. The acquisition module is used to acquire a compatible dependency package corresponding to the target software package from a compatible dependency package set according to the identifier of the target software package; the compatible dependency package set includes a software package that supports the non-upgraded software package to run on the second operating system.

[0018] In another possible implementation, the device further includes: a modification module. The acquisition module is further used to acquire a dependent package that supports the target software package to run on the first operating system; and the modification module is used to modify the package name of the dependent package to obtain a compatible dependent package.

[0019] In another possible implementation, the device further includes: a backup module. The acquisition module is further configured to acquire relevant information of the target software package from the target database; and the backup module is configured to back up relevant information of the target software package to a storage space.

[0020] In another possible implementation, the device further includes: an update module. The acquisition module is further configured to acquire relevant information of the target software package from the storage space; and the update module is configured to update the relevant information of the target software package to the target database.

[0021] In yet another possible implementation, the update module is further configured to update the dependency relationship between the target software package and the compatible dependent package into the relevant information of the target software package in the target database.

[0022] In yet another possible implementation, the target database is an Rpm database.

[0023] In yet another possible implementation, the backup module is further configured to back up a predetermined directory in the first operating system during the process of migrating the first operating system to the second operating system.

[0024] In a third aspect, an embodiment of the present application provides a computing device, which includes a processor and a memory; the processor is coupled to the memory; the memory is used to store computer instructions, and the computer instructions are loaded and executed by the processor to enable the computing device to implement the method of the first aspect above.

[0025] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes: computer software instructions; when the computer software instructions are executed in a computing device, the computing device implements the method of the first aspect above.

[0026] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a computing device, the computing device executes the steps of the related method described in the first aspect above to implement the method of the first aspect above.

[0027] The beneficial effects of the second to fifth aspects mentioned above can be referred to the corresponding description of the first aspect and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 A schematic diagram of the composition of a computing device provided in an embodiment of the present application;

[0029] Figure 2 A schematic diagram of the interaction between software modules involved in an operating system migration process provided by an embodiment of the present application;

[0030] Figure 3 A flowchart of an operating system migration method provided in an embodiment of the present application;

[0031] Figure 4 A flowchart of another operating system migration method provided in an embodiment of the present application;

[0032] Figure 5 A flowchart of another operating system migration method provided in an embodiment of the present application;

[0033] Figure 6 A flowchart of another operating system migration method provided in an embodiment of the present application;

[0034] Figure 7 A schematic diagram of an operating system migration process provided in an embodiment of the present application;

[0035] Figure 8 A schematic diagram of the composition of an operating system migration device provided in an embodiment of the present application;

[0036] Fig. 9 A schematic diagram of the composition of another computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0038] It should be noted that, in the embodiments of the present application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0039] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical items or similar items with basically the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order.

[0040] The technical terms involved in the embodiments of the present application are explained below.

[0041] 1. Rpm, Red Hat Package Manager, is a package manager (software program) used to manage various Linux packages. It follows the GNU General Public License (GPL) rules and is powerful and convenient. The package management method based on Rpm can make Linux easy to install and upgrade, thereby improving the applicability of Linux.

[0042] 2. CentOS, community enterprise operating system, whose full English name is community enterprise operating system, is a server operating system provided free of charge by the open source community and is one of the Linux distributions.

[0043] 3. Dependent packages. In an operating system, a dependent package refers to a software package or program package required for a business application or program to run. When a business application depends on the functions of other programs or library files, these dependent programs or library files are called dependent packages. These dependent packages are usually dynamic libraries or static libraries that can provide the program with the required functions, data structures, algorithms and other resources. For example, if a program needs to use the functions provided in a certain software package to perform a specific operation, then this software package is the dependent package of the program.

[0044] 4. Dracut, a bootable random access memory (RAM) disk imaging tool, is used to generate initramfs (initial RAM file system). Initramfs is a temporary file system loaded into memory before the operating system starts, and its function is to guide the normal startup of the operating system. During the Linux boot process, initramfs is a temporary root file system that contains the necessary drivers and file system tools required during the operating system startup process. These necessary drivers and file system tools can help the operating system identify and load the required device drivers during the startup process, and allow the operating system to smoothly enter the normal running mode after startup. In addition, Dracut can also customize initramfs according to user needs to meet user-specific needs. For example, users can add specific drivers for use during the boot process.

[0045] As the open source community announced the cessation of CentOS services, for enterprises, the cessation of CentOS services will lead to problems such as the failure to evolve system products and resolve security vulnerabilities, which will bring serious security risks to business applications deployed on existing network servers, and in turn bring serious system security issues and business continuity risks to users, and even cause significant economic losses. Therefore, for enterprises, it is necessary to migrate the operating system to other versions to ensure the security and operational stability of business applications.

[0046] The migration of operating system is not a simple reinstallation of the operating system, but requires the replacement, adaptation or upgrade of the operating system and the application software or business system installed on it. There are many issues to be considered in actual engineering practice, such as compatibility analysis, business integrity in complex business scenarios, and migration efficiency. Among them, the migration of operating system can be understood as updating one type of operating system to another type of operating system (such as updating a foreign operating system such as CentOS to a domestic operating system such as fusionOS), or it can be understood as upgrading the operating system from a lower version to a higher version.

[0047] For business applications, new versions of business applications may be less stable than old versions of business applications due to the short time of online release and incomplete testing. Therefore, during the operating system migration process, various business applications installed in the operating system are often upgraded. Therefore, in order to ensure the stability of existing business applications, users often hope to retain the software packages corresponding to some business applications without upgrading. However, in this case, the migration process of the operating system is prone to migration failure.

[0048] The reasons for the failure of operating system migration are as follows: During the migration of the operating system, if a certain software package (such as the target software package) needs to be retained without upgrading, the dependent packages corresponding to the target software package need to be retained without upgrading at the same time. The dependent packages may have version conflicts in the new operating system, resulting in the failure of the operating system migration. For example, the user wants to retain the software package nginx-1.18 without upgrading. The operation of nginx-1.18 depends on openssl-libs-1.0.2. However, most software in the new operating system depends on openssl-libs-1.1.1, so openssl-libs version 1.1.1 is automatically installed during the migration of the operating system. However, different versions of the same software package cannot exist in the same operating system at the same time, so openssl-libs-1.0.2 and openssl-libs-1.1.1 conflict and cannot coexist, resulting in the failure of the operating system migration.

[0049] In addition, the dependency packages that cause version conflicts are usually low-level software packages, such as openssl-libs-1.1.1, which most software on the new operating system depends on to run properly. Therefore, when version conflicts occur, the problem cannot be solved by conventional means of ignoring or uninstalling the dependency package, which will lead to the failure of operating system migration.

[0050] To resolve the operating system migration failure caused by version conflicts, users can only redeploy business applications, which cannot guarantee the integrity of business data and may cause problems in restoring business data. Moreover, the redeployment of business applications takes a long time.

[0051] In summary, there is an urgent need for a solution that can solve the version conflict problem after operating system migration and ensure that the operating system migration is completed normally.

[0052] Based on this, an embodiment of the present application provides an operating system migration method, which deletes the relevant information of the target software package from the target database before the operating system is migrated. Since the migration of the operating system is based on the record of the software package in the target database. Therefore, the operating system will think that the target software package is not installed, and will not process the target software package during the migration process, so that the operating system will not report an error due to compatibility issues during the migration process, so that the operating system can complete the migration normally. Finally, the compatible dependency package is installed on the migrated operating system to ensure that the target software package can run normally on the new operating system. The embodiments provided by the present application are specifically introduced below in conjunction with the accompanying drawings of the specification.

[0053] The technical solution provided in the embodiments of the present application can be applied to a computing device, which may specifically be a blade server, a high-density server, a rack server, or a high-performance server. Figure 1 is a schematic diagram of the system architecture of a computing device, such as Figure 1 As shown, the hardware of the computing device includes a processor, an out-of-band controller, a storage and a memory, and the software includes an out-of-band management module and an operating system (OS).

[0054] The out-of-band management module runs in the out-of-band controller, and the OS runs on the processor (such as Figure 1 shown).

[0055] The out-of-band management module may be a management unit of a non-business module. For example, the out-of-band management module may remotely maintain and manage a computing device through a dedicated data channel. The out-of-band management module is completely independent of the operating system of the computing device and may communicate with the basic input output system (BIOS) and the OS through the out-of-band management interface of the computing device.

[0056] Exemplarily, the out-of-band management module may include a management unit for computing device operation status, a management system in a management chip outside a processor, a computing device baseboard management controller (baseboard management controller, BMC), a system management module (system management mode, SMM), etc. It should be noted that the embodiments of the present application do not limit the specific form of the out-of-band management module, and the above is only an exemplary description.

[0057] Memory, also known as internal memory or main memory, is installed in the memory slot on the motherboard of the computing device. The memory communicates with the memory controller through a memory channel. The memory has at least one memory column, each memory column is located on one side of the memory, each memory column includes at least one sub-memory column, and the memory column or sub-memory column includes multiple memory chips (devices). Each memory chip is divided into multiple storage array groups (bankgroups), each storage array group includes multiple storage arrays (banks), each storage array is divided into multiple storage cells (cells), each storage cell has a row address and a column address, and each storage cell includes one or more bits. In one division method, the memory can be divided into memory chips, storage array groups, storage arrays, storage rows / storage columns, storage cells, and bits from the upper level to the lower level, wherein the addresses of memory particles, storage array groups, storage arrays, storage rows, storage columns, storage cells, and bits on the memory are real physical addresses. In another division method, the CPU divides the memory chip into multiple memory pages based on the paging mechanism, where the address of the memory page is a virtual address that needs to be converted before it becomes a real physical address.

[0058] The memory may be a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computing device, or an external storage device such as a USB flash drive.

[0059] In an embodiment of the present application, a user may pre-install operating system migration software in a memory to enter a pre-installed environment, so that the user can migrate the original operating system on the computing device.

[0060] It should be noted that the system architecture and application scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0061] Figure 2 The following is a schematic diagram of the interaction between software modules involved in an operating system migration process provided by an embodiment of the present application. Figure 2 As shown, it includes two parts: one is the operating system to be migrated (ie, the operating system before migration), and the other is the migration platform, that is, the software module for executing the operating system migration method provided in the embodiment of the present application.

[0062] The operating system to be migrated includes the bottom operating system kernel, the operating system file system, and various software packages (software packages 1-n) installed in the operating system. The operating system file system also has an Rpm database (Rpmdb) installed, which is used to record relevant information of each software in the operating system. The relevant information includes the name, version (version), dependency information (requires), configuration file, and modification history record of the software package.

[0063] The migration platform includes a user interface management module, a core function module and a common module. The user interface management module is used to provide an operation interface for operating system migration related operations to facilitate user interaction. The core function module is used to implement related functions during operating system migration. The common module is responsible for some general functions.

[0064] The core functional modules specifically include: compatibility analysis module, backup module, migration module and rollback module. The compatibility analysis module is used to analyze the overall differences of the operating system and whether there are conflicts in the software package by analyzing the changes in the application binary interface (ABI), the changes in the software package version, the changes in the software package dependency, hardware compatibility and other information. The backup module is used to back up key data using methods such as local or remote backup. The migration module is used to use the yum (yellow dog updater) management tool or the dnf (dandified yum) management tool, combined with the compatibility analysis results, to formulate corresponding strategies, uninstall, retain, upgrade and convert the software package, and complete the overall migration of the operating system. The rollback module is used to build a dedicated rollback initramfs and vmlinux through dracut and rely on backup files to roll back key directories to implement the rollback of the operating system.

[0065] In addition, the core functional modules also include: a retained package migration analysis module, which is used to delete all information of the target software package from the Rpm database and inform the migration module to perform the migration task.

[0066] The public modules include: log module, user management module and deployment module. The log module is responsible for the generation and centralized management of logs during the operation of the migration platform. The user management module is used to manage user registration, login and other related functions. The deployment module is responsible for the installation and uninstallation of various software packages.

[0067] In an embodiment of the present application, in the scenario of operating system migration, the user can select the software packages that need to be retained in the operating system to be migrated (i.e., the software packages that are not to be upgraded). (1) The compatibility analysis module in the migration platform performs a compatibility analysis on the software packages that need to be retained, and analyzes all incompatible packages, i.e., the target software packages. The retained package migration analysis module determines the target software package based on the compatibility analysis module, and (2) deletes all information related to the target software package from the Rpm database (data is backed up before deletion). Then, (3) the retained package migration analysis module notifies the migration module to perform an overall migration of the operating system to be upgraded.

[0068] Optionally, during the migration process, the backup module can back up the key operating system directories in the operating system to be migrated and save them in the backup directory. When necessary, the rollback module can roll back the operating system based on the backup in the backup directory (such as Figure 2 The dashed line part).

[0069] Figure 3The following is a flowchart of an operating system migration method provided in an embodiment of the present application. For example, the operating system migration method provided in an embodiment of the present application can be applied to Figure 1 computing device, or Figure 2 In the migration platform shown, the following description is given by taking a computing device as an execution subject as an example.

[0070] like Figure 3 As shown, the operating system migration method provided in the embodiment of the present application may specifically include the following steps:

[0071] S301: Determine a target software package in a first operating system.

[0072] The first operating system is the operating system to be migrated.

[0073] The target software package is a software package that is not upgraded during the migration from the first operating system to the second operating system; and the software package on which the target software depends when running in the first operating system is incompatible with the second operating system.

[0074] It should be understood that, as described in the background art, during the migration of an operating system, if a user needs to keep a certain software package, the dependent packages of the software package need to be kept. However, these dependent packages will conflict with other software packages on the new operating system (second operating system), which means that there is a compatibility problem with the target software package during the migration process.

[0075] Optionally, the above S301 can be implemented as the following steps a-d: Step a, obtain the software package to be retained. Step b, determine the dependent packages of the software package to be retained; the dependent packages are software packages that support the software package to be retained to run on the first operating system. Step c, determine whether there is a version conflict for the dependent package on the second operating system, and the version conflict is used to indicate that different versions of the dependent package exist in the second operating system. Step d, in the event of a version conflict, determine that the software package to be retained is the target software package. It can be understood that, for the software packages that the user needs to retain, only the software packages to be retained with compatibility issues are deleted for subsequent processing, which can effectively improve the migration efficiency of the operating system.

[0076] Exemplarily, the computing device may obtain the identifier of the software package to be retained input by the user, and for each software package to be retained, the computing device may determine the dependent package in the first operating system that supports the operation of the software package to be retained. Further, the computing device determines whether a software package of the same type as the dependent package (with the same package name) but of a different version already exists in the second operating system. If so, it is determined that there is a version conflict in the dependent package on the second operating system, and the software package to be retained corresponding to the dependent package is incompatible with the second operating system, which will cause the target software package to fail in subsequent operating system migration.

[0077] It should be understood that if there is no compatibility issue in the software package to be retained, there will be no problem causing the operating system migration to fail.

[0078] S302: Delete relevant information of the target software package from the target database.

[0079] The target database is used to record the relevant information of each software package in the first operating system before and after the migration of the first operating system. Figure 7 Before the migration, the target database records the relevant information of the software package in the first operating system, and after the migration, the target database records the relevant information of the software package in the second operating system.

[0080] It should be understood that the target database records the relevant information of each software package in the current operating system. During the migration process of the operating system, the migration is performed based on the list of software packages recorded in the target database. Therefore, in the embodiment of the present application, the computing device can query and determine the relevant information of the target software package from the target database according to the identifier of the target software package, and delete the relevant information from the target database, so as to ensure that the target software package is ignored during the subsequent migration of the operating system.

[0081] Exemplarily, the relevant information of the target software package recorded in the target database may include information such as version, requires, provides, files, conflicts, obsoletes, and spec. Version refers to the version number of the software package. It is usually a string, such as "1.0.0", which means that this is version 1.0.0 of the software package. Requires lists other software packages or system components that the software package depends on to run, that is, a software package may require a specific version of another software package to run. Provides indicates which functions the software package provides that other software packages need, so that other software can find the dependencies they need by querying this software package. In other words, provides can indicate which other software packages the software package can be used as a dependency package of. Files lists the list of files installed by the software package, which may include binary files, configuration files, documents, etc. Conflicts lists other software packages that are incompatible with the software package. Usually, if these conflicting software packages are installed at the same time, it may cause problems or conflicts. Obsoletes means that if this software package is installed, then another software package in the operating system will be marked as obsolete or no longer required. Spec usually refers to a specific specification or standard file that describes how to build and package software programs. In most Linux distributions, the spec file is used to describe how to build the Rpm package. This file contains various metadata as well as the instructions and scripts required for building.

[0082] Optionally, the target database is an Rpm database. The Rpm database can record various information about the software package and its files, and the Rpm package manager manages the software package based on the Rpm database.

[0083] S303: Migrate the first operating system to the second operating system based on the target database.

[0084] In the embodiment of the present application, after deleting the relevant information of the target software package from the target database, the operating system can be migrated based on the deleted target database to migrate the current first operating system to the second operating system.

[0085] Optionally, you can use the yum tool or the dnf tool to implement the operating system migration process.

[0086] It is understandable that in the above S302, the relevant information of the target software package in the target database is deleted (the actual running files of the target software package are still stored in the computing device). Since the migration of the operating system is based on the software package list recorded in the target database, the computing device will not process the target software package during the operating system migration process. In other words, during the operating system migration process, the computing device will think that the target software package is not installed, which is equivalent to bypassing the target software package for migration. In this way, there will be no error or alarm caused by the compatibility problem of the target software package leading to the failure of the migration, that is, the operating system can complete the migration normally.

[0087] S304: Install a compatible dependency package on the second operating system.

[0088] The compatible dependency package is used to support the target software package to run compatibly on the second operating system.

[0089] It should be understood that by deleting the relevant information of the target software package in the target database, it is possible to bypass the target software package and ensure that the normal migration of the operating system is completed. However, for the target software package, it is impossible to run normally on the operating system (second operating system) after migration because the necessary dependency packages are lacking to support its operation. Because the dependency package of the target software package may also be upgraded with the migration of the operating system (such as the target software package nginx-1.18 depends on openssl-libs-1.0.2, but openssl-libs-1.0.2 will also be upgraded to openssl-libs-1.1.1 after the operating system is migrated). Therefore, in order to ensure the normal operation of the target software package, a compatible dependency package supporting the operation of the target software package can be installed on the second operating system to solve the operation problem of the target software package.

[0090] In one implementation, before S304, the computing device may obtain the compatible dependency package by searching for the compatible dependency package corresponding to the target software package from a compatible dependency package set according to the identifier of the target software package. The compatible dependency package set includes software packages that support the non-upgraded software package to run on the second operating system.

[0091] It is understandable that the computing device can pre-configure the compatible dependency package set used by various software packages to run on the second operating system. The compatible dependency package set can be stored locally (such as on the computing device) or on the network side. When the operating system migration is completed, the computing device can query the compatible dependency package corresponding to the target software package from the compatible dependency package set, and install the compatible dependency package on the second operating system to support the normal operation of the target software package on the second operating system. The method of directly querying and obtaining the compatible dependency package from the pre-configured compatible dependency package set and installing it can greatly improve the migration efficiency.

[0092] In another implementation, before S304, the computing device may also obtain a compatible dependency package in the following manner: step a, obtaining a dependency package that supports the target software package to run on the first operating system; step b, changing the package name of the dependency package to obtain a compatible dependency package.

[0093] It is understandable that, as mentioned above, the dependency package has version conflict problems because different versions of the same software package exist on the same operating system at the same time. That is to say, the target software package (such as nginx-1.18) runs on the second operating system and needs the support of the old version of the dependency package (such as openssl-libs-1.0.2), but the second operating system will install the new version of the dependency package (openssl-libs-1.1.1) by default. In this case, it is impossible to reinstall the old version of the dependency package on the second operating system. Therefore, the computing device can change the package name of the old version of the dependency package (for example, change openssl-libs-1.0.2 to compat-openssl-libs-1.0.2) to obtain a compatible dependency package and then install it. In this way, for the computing device or operating system, it will be considered that the dependency package with the modified package name is a new type of software package that is not available in the existing operating system, so the version conflict problem will not be reported during the installation process. It is easy to understand that the essence of the compatible dependency package is consistent with the old version of the dependency package (consistent in function), and only the package name is different. This method of changing the package name of the dependent package can directly obtain the corresponding compatible dependent package, which is applicable to any type of software package and can effectively improve the versatility of the operating system migration method.

[0094] The computing device obtains the dependency package of the target software package running on the first operating system by obtaining and saving it in advance before the operating system migration. Alternatively, after the operating system migration, the computing device temporarily downloads the corresponding dependency package from the network and further modifies the package name to obtain a compatible dependency package. This embodiment of the application does not specifically limit this.

[0095] As mentioned above, the target database is used to record the relevant information of each software package in the first operating system before and after the migration of the first operating system, and the subsequent management of each software package in the migrated operating system (such as upgrade, change, uninstallation, etc.) is also dependent on the target database. However, since the target database no longer has the relevant information of the target software package, it is inconvenient to manage and maintain the target software package.

[0096] Therefore, combined with Figure 3 ,like Figure 4 As shown, the operating system migration method provided in the embodiment of the present application also includes the following:

[0097] S401, obtaining relevant information of a target software package from a target database.

[0098] S402: Back up relevant information of the target software package to a storage space.

[0099] The above S401 and S402 may be performed before the above S302. That is, before deleting the relevant information of the target software package from the target database, the computing device may query and obtain the relevant information of the target software package from the target database, and save it after backing it up, so as to facilitate subsequent data recovery. The storage space for backing up and saving may be a local storage space of the computing device or a storage space on the network side, which is not specifically limited in the embodiments of the present application.

[0100] Combination Figure 3 ,like Figure 5 As shown, after the operating system migration is completed in S303, the operating system migration method provided in the embodiment of the present application further includes the following:

[0101] S403: Obtain relevant information of the target software package from the storage space.

[0102] S404: Update the target database with the relevant information of the target software package.

[0103] With respect to the above S403 and S404, after the operating system migration is completed, the computing device can obtain the relevant information of the target software package from the storage space, and update and restore the relevant information to the target database. In this way, the relevant information of the target software package is re-recorded in the target database, so that the user can conveniently maintain the target software package in the subsequent use of the new operating system.

[0104] In addition, the target database also records the dependencies of each software package (requires), that is, which dependent packages are needed for the operation of a software package. Figure 3 ,like Figure 6 As shown, the operating system migration method provided in the embodiment of the present application also includes the following:

[0105] S305: Update the dependency relationship between the target software package and the compatible dependent package into the relevant information of the target software package in the target database.

[0106] The dependency relationship is used to reflect the relationship between the software package that supports the running of the target software package and the target software package.

[0107] The above S305 can be executed after the above S304. It should be understood that in the embodiment of the present application, the computing device backs up the relevant information of the target software package when it runs on the first operating system. After the operating system migration is completed, the dependency of the target software package has changed, so the dependency of the software package is not the latest in the relevant information restored through the backup. Therefore, after installing the compatible dependency package on the second operating system, the computing device can update the dependency between the target software package and the compatible dependency package to the target database, so that the user can maintain the dependency of the target software package in the subsequent use of the operating system.

[0108] Optionally, the operating system migration method provided in the embodiment of the present application also includes the following S306.

[0109] S306: During the process of migrating the first operating system to the second operating system, back up a predetermined directory in the first operating system.

[0110] It should be understood that the predetermined directory is used to store the core files of the first operating system. Backing up the predetermined directory can facilitate the subsequent rollback of the operating system when the migrated second operating system fails to run, thereby ensuring the fault tolerance of the migration solution.

[0111] The following is a complete description of the operating system migration method provided in the embodiment of the present application in conjunction with specific examples. Figure 7 A schematic diagram of an operating system migration process provided in an embodiment of the present application is shown in FIG. Figure 7 As shown. First, determine that nginx1.0 is the target software package that needs to be retained, 1. Obtain the corresponding relevant information in the Rpm database and back it up, 2. Delete these relevant information from the Rpm database. Further, 3. Perform operating system migration based on the deleted Rpm database, wherein most software packages in the operating system are also upgraded to new versions. For example, aaa.1.0 is upgraded to aaa.3.0, httpd.1.0 is upgraded to httpd.2.0, openssl-libs-1.0.2 is upgraded to openssl-libs-1.1.1, and so on. However, the target software package is still nginx1.0, and the version is not updated accordingly. Then, 4. Restore the backed-up information to the Rpm database. Further, on the migrated operating system, 5. Install the compatible dependency package compat-openssl-libs-1.0.2 to support the normal operation of nginx1.0. At this point, the operating system migration is complete.

[0112] The embodiment of the present application provides an operating system migration method, which deletes the relevant information of the target software package from the target database before the operating system is migrated. Since the migration of the operating system is based on the record of the software package in the target database, the operating system will think that the target software package is not installed, and will not process the target software package during the migration process, so that the operating system will not report an error due to compatibility issues during the migration process, so that the operating system can complete the migration normally. Finally, the compatible dependency package is installed on the migrated operating system to ensure that the target software package can run normally on the new operating system.

[0113] Furthermore, before deleting the relevant information, the relevant information is backed up to facilitate restoration to the target database after the operating system migration is completed, which is convenient for the subsequent management and maintenance of the software package. In addition, updating the dependency relationship between the compatible dependency package and the target software package to the target database can further facilitate the operation and maintenance management of the software package and improve the user experience. Compared with the redeployment solution, this method is more efficient and saves more upgrade time. In addition, it can save the backup storage space required for redeployment and save the storage resources of the computing device.

[0114] It can be seen that the above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, the embodiment of the present application provides a hardware structure and / or software module corresponding to each function. It should be easily appreciated by those skilled in the art that, in combination with the modules and algorithm steps of each example described in the embodiment disclosed herein, the embodiment of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0115] In an exemplary embodiment, the present application also provides an operating system migration device. The migration device may be the aforementioned computing device, or may be a processor in the computing device. The migration device may include one or more functional modules for implementing the operating system migration method of the above method embodiment.

[0116] For example, Figure 8 A schematic diagram of the composition of an operating system migration device provided in an embodiment of the present application. Figure 8 As shown, the operating system migration device includes: a determination module 801, a deletion module 802, a migration module 803 and an installation module 804. The determination module 801, the deletion module 802, the migration module 803 and the installation module 804 are connected to each other.

[0117] The determination module 801 is used to determine the target software package in the first operating system; wherein the target software package is a software package that is not upgraded and is incompatible with the first operating system during the migration to the second operating system; the deletion module 802 is used to delete the relevant information of the target software package from the target database; the target database is used to record the relevant information of each software package in the first operating system before and after the migration of the first operating system; the migration module 803 is used to migrate the first operating system to the second operating system based on the target database; the installation module 804 is used to install a compatible dependency package on the second operating system; the compatible dependency package is used to support the target software package to run compatibly on the second operating system.

[0118] In a possible implementation, the determination module 801 is specifically used to obtain a software package to be retained; determine a dependent package of the software package to be retained; the dependent package is a software package that supports the software package to be retained to run on the first operating system; determine whether there is a version conflict in the dependent package on the second operating system; the version conflict is used to indicate that different versions of the dependent package exist in the second operating system; if there is a version conflict, determine that the software package to be retained is the target software package.

[0119] In another possible implementation, the apparatus further includes: an acquisition module 805. The acquisition module 805 is used to acquire a compatible dependency package corresponding to the target software package from a compatible dependency package set according to the identifier of the target software package; the compatible dependency package set includes a software package that supports the non-upgraded software package to run on the second operating system.

[0120] In another possible implementation, the apparatus further includes: a modification module 806. The acquisition module 805 is further configured to acquire a dependent package that supports the target software package to run on the first operating system; the modification module 806 is configured to modify the package name of the dependent package to obtain a compatible dependent package.

[0121] In another possible implementation, the above device further includes: a backup module 807. The acquisition module 805 is further configured to acquire relevant information of the target software package from the target database; the backup module 807 is configured to back up relevant information of the target software package to a storage space.

[0122] In another possible implementation, the above device further includes: an updating module 808. The acquiring module 805 is further configured to acquire relevant information from the storage space; and the updating module 808 is configured to update the relevant information to the target database.

[0123] In yet another possible implementation, the updating module 808 is further configured to update the dependency relationship between the target software package and the compatible dependent package into the relevant information of the target software package in the target database.

[0124] In yet another possible implementation, the target database is an Rpm database.

[0125] In yet another possible implementation, the backup module 807 is further configured to back up a predetermined directory in the first operating system during the process of migrating the first operating system to the second operating system.

[0126] In an exemplary embodiment, the present application also provides a computing device. Fig. 9 A schematic diagram of the composition of a computing device provided in an embodiment of the present application. Fig. 9 As shown, the computing device may include: a processor 901 and a memory 902; the memory 902 stores instructions executable by the processor 901; when the processor 901 is configured to execute the instructions, the computing device implements the method described in the aforementioned method embodiment.

[0127] The embodiment of the present application also provides a computer-readable storage medium. All or part of the processes in the above method embodiment can be completed by computer instructions to instruct the relevant hardware, and the program can be stored in the above computer-readable storage medium. When the program is executed, it may include the processes of the above method embodiments. The computer-readable storage medium can be any of the above embodiments or memory. The above computer-readable storage medium can also be an external storage device of the above recovery device, such as a plug-in hard disk, a smart memory card (smart media card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. equipped on the above recovery device. Further, the above computer-readable storage medium can also include both the internal storage unit of the above recovery device and an external storage device. The above computer-readable storage medium is used to store the above computer program and other programs and data required for the above recovery device. The above computer-readable storage medium can also be used to temporarily store data that has been output or is to be output.

[0128] An embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program product is run on a computer, the computer is enabled to execute any one of the operating system migration methods provided in the above embodiments.

[0129] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit can implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0130] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

[0131] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for migrating an operating system, characterized in that: The method comprises: Determine a target software package in the first operating system; wherein the target software package is a software package that is not upgraded and is incompatible with the first operating system during the process of migrating to the second operating system; Deleting the relevant information of the target software package from the target database; the target database is used to record the relevant information of each software package in the first operating system before and after the migration of the first operating system; Based on the target database, migrating the first operating system to the second operating system; Installing a compatible dependency package on the second operating system; the compatible dependency package is used to support the target software package to run compatibly on the second operating system; Before and after the operating system is migrated, the actual running files of the target software package are stored in the computing device.

2. The method according to claim 1, characterized in that The step of determining the target software package in the first operating system includes: Get the software package to be retained; Determine a dependent package of the software package to be retained; the dependent package is a software package that supports the software package to be retained to run on the first operating system; Determine whether there is a version conflict of the dependent package on the second operating system; the version conflict is used to indicate that different versions of the dependent package exist in the second operating system; In the case of a version conflict, the software package to be retained is determined to be the target software package.

3. The method according to claim 1 or 2, characterized in that: Before installing the compatible dependency package on the second operating system, the method further includes: According to the identifier of the target software package, a compatible dependency package corresponding to the target software package is obtained from a compatible dependency package set; the compatible dependency package set includes a software package that supports the non-upgraded software package to run on the second operating system.

4. The method according to claim 1 or 2, characterized in that: Before installing the compatible dependency package on the second operating system, the method further includes: Acquire a dependent package that supports the target software package to run on the first operating system; The package name of the dependent package is changed to obtain the compatible dependent package.

5. The method according to any one of claims 1 to 4, characterized in that: Before deleting the relevant information of the target software package from the target database, the method further includes: Acquire relevant information of the target software package from the target database; Back up the relevant information of the target software package to the storage space.

6. The method according to claim 5, characterized in that After migrating the first operating system to the second operating system, the method further includes: Acquire relevant information of the target software package from the storage space; The target database is updated with the relevant information of the target software package.

7. The method according to claim 6, characterized in that The method further comprises: The dependency relationship between the target software package and the compatible dependent package is updated into the relevant information of the target software package in the target database.

8. The method according to any one of claims 1 to 7, characterized in that: The target database is the Red Hat Package Manager Rpm database.

9. The method according to any one of claims 1 to 8, characterized in that: The method further includes: during the process of migrating the first operating system to the second operating system, backing up a predetermined directory in the first operating system.

10. A computing device, characterized in that The computing device includes a processor and a memory; the processor is coupled to the memory; the memory is used to store computer instructions, and the computer instructions are loaded and executed by the processor to enable the computing device to implement the operating system migration method as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Method and device for automatically installing software package, computer equipment and storage medium

    CN113867744A

  • Industrial application package management

    CN115668133A

  • Software package management

    US20010029605A1