Cloud Foundry is a cloud computing Platform-as-a-Service (PaaS) that allows quick development and deployment of web applications. One of its many benefits is that it's open source, which means that applications can be easily deployed to different Cloud Foundry providers.

CenturyLink AppFog is our Cloud Foundry platform. With AppFog, applications deploy quickly and scale automatically while having access to the full range of CenturyLink Cloud products.

Migrating Your Cloud Foundry App to CenturyLink AppFog

This tutorial is for Cloud Foundry users who already have applications deployed to another Cloud Foundry provider. We will walk through the simple steps needed to migrate your application to AppFog.

The Cloud Foundry CLI

This tutorial assumes that you are using Version 6 of the Cloud Foundry Command-Line Interface (CLI). You can get instructions for installing the CLI on the project homepage.

The CLI keeps its configuration in the $HOME/.cf directory. Before running any of the commands we give you, make a backup using the following commands:

$ cd $HOME
$ mv .cf .cf-backup

Later on, we'll show you how to switch between multiple configurations from the command line.

Getting a CenturyLink Cloud Account

The first step in migrating your application to AppFog is to sign up for a free CenturyLink Cloud trial account.

  1. Go to CenturyLink Cloud.
  2. Click Start Free Trial.
  3. Follow the on-screen instructions.

Deploying Your Application to AppFog

The next step is to configure AppFog in your CenturyLink Cloud account. You can read more about AppFog basics in the Getting Started Guide.

Enable AppFog

First, enable AppFog in the CenturyLink Cloud Control Panel.

  1. Go to Control Portal and log in.
  2. Select AppFog from the pull-down menu. Choosing Appfog
  3. Select the region that will host your AppFog instances. Region Selection

Login to AppFog using the Cloud Foundry Tools

Now that AppFog is set up in your CenturyLink Cloud account, you need to login to AppFog using the Cloud Foundry CLI. The Control Panel gives you an exact command from the Overview tab.

  1. Find the cf login command on the AppFog control panel. It looks similar to the following:
    cf login -a -o C007 -u your.username
    CF Login
  2. Run the command in your project directory.
  3. Enter your CenturyLink Cloud password when prompted. Password
  4. Select the Dev application space. Dev App Space

To learn more about logging into AppFog using the Cloud Foundry command-line tools, read this article from our Knowledge Base.

Deploy Your Application

After the initial configuration and login, deployment is just one command.

Run the following command in your project directory, replacing <my-project-name> with the name of your project.

    $ cf push <my-project-name>

A successful deployment produces a lot of output and looks similar to the following when completed: Deployed App

You can limit the resources allocated to your application by passing options to the cf push command. For instance, to allocate only 256 MB of memory and 512 MB of disk space, use the following command.

   $ cf push -m 256M -k 512M <my-project-name>

Using Multiple Cloud Foundry Configurations

The Cloud Foundry CLI tool can access different configurations. It reads the CF_HOME environment variable to determine which directory to search for login credentials and other configuration options. For example, to get a list of applications running in your previous configuration, run the following command.

$ CF_HOME=$HOME/.cf-backup cf apps

Running on AppFog

Once your application has been successfully migrated, it's time to examine which other cloud services your application might need. One of the benefits of AppFog is that it is part of the CenturyLink Cloud family of products. We offer a comprehensive suite of cloud products, from virtual cloud servers to managed enterprise applications. Check out the CenturyLink Cloud Home Page for a complete list of our cloud products and services.