Skip to content

# Migrating from 1.x to 2.0

This document provides guidance on migrating code from version 1.x to version 2.0.0. It covers the major changes introduced in the new version and outlines the necessary modifications you need to make in your code to ensure compatibility.

## Table of Contents

- New to Nautobot v2.0.0
  - Enhanced Filter Fields
- Changes to Nautobot in v2.0.0
  - Database (ORM) Changes
    - Database Field Behavior Changes
    - Renamed Database Fields
    - Removed Database Fields
  - Generic Role Model
  - Collapse Site and Region into Location
  - Aggregate model Migrated to Prefix
  - Renamed Database Foreign Keys and Related Names
  - Renamed Filter Fields
  - Corrected Filter Fields
  - Jobs
- Steps to Migrate an App from V1
  - Preliminary Steps:
    - Add `pylint-nautobot` as a development dependency
    - Run `pylint -v --disable=all --enable=nautobot-code-location-changes,nautobot-replaced-models *` in order to parse your development environment for changes that need to be fixed before pylint-django can successfully run.
    - Specific steps to install and run `pylint-nautobot` in your development environment is available here
  - Dependency Updates
    - Nautobot Version
    - Python Version
    - pylint-nautobot
  - Code Updates
    - Update Code Import Locations
    - Replace PluginMenuItem with NavMenuItem
    - Remove Tag/Tags Filter Field from FilterSet Definitions
    - Replace DjangoFilterBackend with NautobotFilterBackend
    - App Model Serializer Inheritance
    - Revamp Rest API Serializers
    - Revamp CSV Import and Export
  - Model Updates
    - Global
      - Replace the Usage of Slugs
    - DCIM
      - Replace Site and Region with Location Model
    - Extras
      - Replace Role Related Models with Generic Role Model
      - Update Job and Job related models
        - Job Model Changes
        - Job Logging Changes
        - JobResult Model Changes
      - Update CustomField, ComputedField, and Relationship
    - IPAM
      - Replace Aggregate with Prefix
      - Introduction of Namespace
      - Concrete Relationship between Prefix and IP Address
      - Concrete Relationship between Prefix and Self
      - Convert Relationship Type between Prefix and VRF to Many to Many